Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions AR-MIX-Live-FX-Host-Standalone-v0.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,40 @@
#app #mixer .fader-zone .meter-signal-area .meter-peak{
left:2px;right:2px;
}

/* P0: common sleeping LCD material for all 10 CH + MASTER, regardless
of channel color, selected state, audio connection or live level.
Pure static inset paint: no CSS animation, filters, blur or new RAF. */
#app #mixer .fader-zone .vu-bank .vu-bars{
background-color:#02070b;
background-image:linear-gradient(90deg,#0b1a20 0%,#020609 13%,#010408 61%,#07131a 100%);
border:0;border-radius:5px;
box-shadow:inset 2px 0 3px #000a,inset -2px 0 3px #000a,
inset 0 3px 3px #000e,inset 0 -2px 2px #122a33;

}
#app #mixer .fader-zone .vu-bank .meter-unit .meter{
background-color:#01060a;
background-image:linear-gradient(90deg,#030c11,#010407 45%,#040e13);
border:0;border-radius:3px;
box-shadow:inset 1px 0 2px #000,inset -1px 0 2px #000,
inset 0 2px 3px #000e,inset 0 -1px 1px #18303a;

}
#app #mixer .fader-zone .vu-bank .meter-unit .meter::after{
inset:0;border:0;border-radius:3px;
background:linear-gradient(180deg,#e8ffff0c,transparent 30%);
}
#app #mixer .fader-zone .vu-bank .meter-signal-area{
background:#010509;border-radius:2px;
}
#app #mixer .fader-zone .vu-bank.is-mono .vu-bars{
flex:0 0 14px;min-width:14px;max-width:14px;width:14px;
}
#app #mixer .fader-zone .vu-bank.is-stereo .vu-bars,
#app #masterLeft .master-fader-zone .vu-bank .vu-bars{
flex:0 0 30px;min-width:30px;max-width:30px;width:30px;
}
</style></head>
<body>
<div id="app" class="app">
Expand Down
115 changes: 115 additions & 0 deletions src/ArSonMixStartupSplash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <juce_gui_basics/juce_gui_basics.h>

// Lightweight native first-paint: inspired by the approved ArSonMix loading
// reference, deliberately vector-only. No WebView2, image decode, animation,
// blocking timer, disk access or per-frame GPU filters. Owning app paints this
// before constructing the browser/device engine on its next message-loop tick.
class ArSonMixStartupSplash final : public juce::Component
{
public:
ArSonMixStartupSplash()
{
setName ("ArSonMix loading");
setOpaque (true);
setSize (740, 420);
centreWithSize (740, 420);
addToDesktop (juce::ComponentPeer::windowHasDropShadow);
setAlwaysOnTop (true);
setVisible (true);
}

void setStage (int stage)
{
stage_ = juce::jlimit (0, 2, stage);
repaint();
}

void paint (juce::Graphics& g) override
{
auto area = getLocalBounds();
g.setGradientFill (juce::ColourGradient (
juce::Colour (0xff0c2332), 0.0f, 0.0f,
juce::Colour (0xff030c15), (float) getWidth(), (float) getHeight(), false));
g.fillAll();
// Mixer strips at the sides are deliberately low-contrast vectors,
// not blurry images or animated native/WebView layers.
for (int side = 0; side != 2; ++side)
for (int i = 0; i != 3; ++i)
{
const int x = side == 0 ? 13 + i * 51 : getWidth() - 59 - i * 51;
const auto strip = juce::Rectangle<float> ((float) x, 54.0f, 42.0f, 288.0f);
g.setColour (juce::Colour (0xff122c3b).withAlpha (0.55f));
g.fillRoundedRectangle (strip, 3.0f);
g.setColour (juce::Colour (0xff244657).withAlpha (0.34f));
g.drawRoundedRectangle (strip, 3.0f, 1.0f);
g.setColour (juce::Colour (0xff030b10));
g.fillRoundedRectangle ((float)x + 8.0f, 104.0f, 7.0f, 174.0f, 2.0f);
for (int j = 0; j < 16; ++j)
{
g.setColour (juce::Colour (j < 12 ? 0xff18c886 : 0xffdfb55c)
.withAlpha (0.12f));
g.fillRect (x + 9, 272 - j * 9, 5, 5);
}
g.setColour (juce::Colour (0xff839ba8).withAlpha (0.22f));
g.fillRoundedRectangle ((float) x + 21.0f, 183.0f, 16.0f, 25.0f, 3.0f);
}

g.setColour (juce::Colour (0xff12bed4));
g.drawHorizontalLine (366, 26.0f, (float)getWidth() - 26.0f);
g.setColour (juce::Colour (0xff09d5d5));
g.setFont (juce::FontOptions (44.0f));
g.drawText ("Ar", 194, 73, 77, 58, juce::Justification::centredRight);
g.setColour (juce::Colour (0xffeaf3f7));
g.drawText ("SonMix", 269, 73, 274, 58, juce::Justification::centredLeft);
g.setColour (juce::Colour (0xff87a8bd));
g.setFont (juce::FontOptions (15.0f));
g.drawText ("N A T I V E V S T 3 F X H O S T", 176, 132, 388, 30,
juce::Justification::centred);

// Static equalizer glyph: a 5-bar detail from the reference image.
for (int i = 0; i < 5; ++i)
{
g.setColour (juce::Colour (0xff1edac2));
const int height = 8 + (2 - std::abs (2 - i)) * 8;
g.fillRoundedRectangle ((float)(355 + i * 8), (float)(183 - height / 2),
5.0f, (float)height, 1.5f);
}

g.setColour (juce::Colour (0xffd9ebf2));
g.setFont (juce::FontOptions (17.0f));
const juce::String status = stage_ == 0 ? "Loading mixer interface..."
: stage_ == 1 ? "Preparing native audio engine..."
: "Mixer interface ready";
g.drawText (status, 145, 213, 450, 28, juce::Justification::centred);
g.setColour (juce::Colour (0xff283c49));
g.fillRoundedRectangle (179.0f, 255.0f, 382.0f, 9.0f, 4.0f);
g.setColour (juce::Colour (0xff17d7b1));
g.fillRoundedRectangle (179.0f, 255.0f, stage_ == 0 ? 105.0f :
stage_ == 1 ? 273.0f : 382.0f, 9.0f, 4.0f);
const juce::String labels[] = {
"Loading interface", "Preparing audio engine", "Ready mixer layout"
};
for (int i = 0; i < 3; ++i)
{
const int y = 282 + i * 24;
g.setColour (juce::Colour (i <= stage_ ? 0xff16dbb0 : 0xff506878));
g.drawEllipse (229.0f, (float)y + 5.0f, 11.0f, 11.0f, 1.3f);
if (i < stage_)
g.fillEllipse (232.0f, (float)y + 8.0f, 5.0f, 5.0f);
g.setColour (juce::Colour (i <= stage_ ? 0xffe1f1f6 : 0xff819aac));
g.setFont (juce::FontOptions (12.0f));
g.drawText (labels[i], 251, y, 286, 23, juce::Justification::centredLeft);
}
g.setColour (juce::Colour (0xff8aaabb));
g.setFont (juce::FontOptions (11.0f));
g.drawText ("ArSonMix | Native VST3 FX Host", 25, 380, 350, 24,
juce::Justification::centredLeft);
g.drawText ("Initializing locally", 470, 380, 245, 24,
juce::Justification::centredRight);
}

private:
int stage_ = 0;
};
38 changes: 34 additions & 4 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <juce_audio_utils/juce_audio_utils.h>
#include <BinaryData.h>
#include "LiveAudioEngine.h"
#include "ArSonMixStartupSplash.h"
#include "VstOrbitController.h"
#include "../engine/core/OrbitDistanceMapping.h"
#include "../engine/core/DearVrPolarPolicy.h"
Expand Down Expand Up @@ -169,19 +170,21 @@ class AudioSetupWindow final : public juce::DocumentWindow
class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, private juce::ChangeListener
{
public:
ConsoleWindow()
explicit ConsoleWindow (std::function<void(int)> onStartupStage)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the startup contract test for the new constructor signature

Changing this signature breaks the existing startup contract test: tests/main_v08_native_integration_test.mjs:73 still searches for ConsoleWindow(), which now matches the destructor, producing an empty constructor slice. Running the suite fails with “GUI navigation must be started from constructor.” The Windows native workflow (.github/workflows/p1-windows.yml) explicitly runs this suite, so its gate fails despite navigation remaining intact. Update the constructor extraction alongside this signature change.

AGENTS.md reference: AGENTS.md:L29-L29

Useful? React with 👍 / 👎.

: DocumentWindow ("AR MIX Studio — Native VST3 FX Host",
juce::Colour (0xff101921), allButtons),
catalog_ (settingsDirectory()),
diagnostics_ (settingsDirectory().getChildFile ("diagnostics")),
presets_ (settingsDirectory().getChildFile ("presets"), settingsDirectory()),
onStartupStage_ (std::move (onStartupStage)),
browser_ (webViewOptions()
.withNativeIntegrationEnabled()
.withEventListener ("arMixGuiReady", [this] (juce::var)
{
browser_.loaded = true;
guiReadyTick_ = juce::Time::getMillisecondCounter();
browser_.repaint();
if (onStartupStage_) onStartupStage_ (1);
})
.withEventListener ("arMixParameter", [this] (juce::var args) { onParameter (args); })
.withEventListener ("arMixAction", [this] (juce::var args) { onAction (args); })
Expand Down Expand Up @@ -228,6 +231,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
PluginCatalog catalog_;
DiagnosticsRecorder diagnostics_;
armix::storage::NativePresetArchive presets_;
std::function<void(int)> onStartupStage_;
Browser browser_;
armix::storage::StudioBackup::Worker studioBackupWorker_;
bool studioBackupBusy_ = false;
Expand Down Expand Up @@ -1476,6 +1480,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
webViewStartupNoticeSent_ = true;
diagnostics_.record ("WEBVIEW2_GUI_READY_TIMEOUT", "No native ArSonMix UI handshake");
engine_.stop();
if (onStartupStage_) onStartupStage_ (3); // dismiss splash before error dialog
showWebViewStartupError ("The embedded mixer did not initialize in 10 seconds."
" Check the WebView2 Runtime and browser-cache folder permissions.");
return;
Expand All @@ -1494,6 +1499,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
engine_.devices().addChangeListener (this);
diagnostics_.record ("STARTUP",
startupError_.isEmpty() ? "Audio device initialized" : startupError_);
if (onStartupStage_) onStartupStage_ (2);
}
// ONE actionable notice per unexpected DIRECT reroute. The audio
// callback has already zero-filled output atomically; status, log and
Expand Down Expand Up @@ -1586,7 +1592,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
}
};

class ConsoleApp final : public juce::JUCEApplication
class ConsoleApp final : public juce::JUCEApplication, private juce::Timer
{
public:
const juce::String getApplicationName() override { return "ArSonMix"; }
Expand All @@ -1604,21 +1610,45 @@ class ConsoleApp final : public juce::JUCEApplication
}
void initialise (const juce::String&) override
{
// Paint the approved dark native splash BEFORE browser cache I/O,
// WebView2 initialization, device scan or native console construction.
splash_ = std::make_unique<ArSonMixStartupSplash>();
startTimer (90); // one-shot handoff after Windows first paint
}
void timerCallback() override
{
stopTimer();
const auto folder = armix::storage::PortableWorkspace::browserDataRoot();
if (!folder.createDirectory().wasOk() && !folder.isDirectory())
{
splash_.reset();
showWebViewStartupError ("Cannot create the browser-cache folder: " + folder.getFullPathName());
return;
}
if (!juce::WebBrowserComponent::areOptionsSupported (webViewOptions()))
{
splash_.reset();
showWebViewStartupError ("WebView2 Runtime could not be initialized on this machine.");
return;
}
window_ = std::make_unique<ConsoleWindow>();
window_ = std::make_unique<ConsoleWindow> ([this] (int stage)
{
if (splash_) splash_->setStage (stage);
if (stage >= 2)
{
splash_.reset(); // no overlay over live mixer after engine init
if (window_) window_->toFront (true);
}
});
}
void shutdown() override
{
stopTimer();
window_.reset();
splash_.reset();
}
void shutdown() override { window_.reset(); }
private:
std::unique_ptr<ArSonMixStartupSplash> splash_;
std::unique_ptr<ConsoleWindow> window_;
};
}
Expand Down
16 changes: 15 additions & 1 deletion tests/main_v08_native_integration_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test('native plugin state and graph preserved',()=>{
});

test('startup never opens an audio device before the WebView2 GUI handshake',()=>{
const constructor=main.slice(main.indexOf('ConsoleWindow()'),main.indexOf('~ConsoleWindow()'));
const constructor=main.slice(main.indexOf('explicit 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');
Expand All @@ -88,3 +88,17 @@ test('master readout remains native-unavailable until measured BS.1770/true peak
assert.match(bridge,/tp\.textContent="—"/);
assert.doesNotMatch(app, /STREAM LEVELS <span>SIM<\/span>/);
});

test('startup uses splash before constructing WebView2 and native engine',()=>{
const splash=read('src/ArSonMixStartupSplash.h');
assert.match(splash,/class ArSonMixStartupSplash/);
assert.match(splash,/setOpaque \(true\)/);
assert.doesNotMatch(splash,/WebBrowserComponent|AudioDeviceManager|repaintTimer/);
const startup=main.slice(main.indexOf('class ConsoleApp final'));
assert.ok(startup.indexOf('make_unique<ArSonMixStartupSplash>') <
startup.indexOf('make_unique<ConsoleWindow>'));
assert.match(startup,/startTimer \(90\)/);
assert.match(startup,/if \(stage >= 2\)/);
assert.match(main,/onStartupStage_ \(1\)/);
assert.match(main,/onStartupStage_ \(2\)/);
});
22 changes: 21 additions & 1 deletion tests/ui_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def same_rect(a,b):
const s=getComputedStyle(e),glass=getComputedStyle(e,'::after');
return {back:s.backgroundColor,glass:glass.content};
})""")
assert len(lcd)>=11 and all(x['back']=='rgb(8, 15, 20)' and x['glass']!='none' for x in lcd),lcd
assert len(lcd)>=11 and all(x['back']=='rgb(1, 6, 10)' and x['glass']!='none' for x in lcd),lcd
await page.set_viewport_size({"width":1680,"height":920})
# Hardware-style PAN illumination must grow from center, both L and R.
pan_fill=page.locator('[data-pan="1"] .pan-fill')
Expand Down Expand Up @@ -922,6 +922,26 @@ def same_rect(a,b):
assert s['bank']['l']>=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
# P0 screenshot regression: sleeping LCD glass, 10 CH + MASTER
# must share identical neutral black material regardless of track color.
lcd_glass=await page.evaluate("""()=>{
return [...document.querySelectorAll('#mixer .fader-zone .vu-bank')].map(bank=>{
const well=bank.querySelector('.vu-bars');
const face=bank.querySelector('.meter-unit .meter');
const wc=getComputedStyle(well),fc=getComputedStyle(face);
return {wellColor:wc.backgroundColor,faceColor:fc.backgroundColor,
width:Math.round(well.getBoundingClientRect().width),
leds:bank.querySelectorAll('.meter-fill').length,
inset:wc.boxShadow.includes('inset'),
filter:wc.filter,blur:wc.backdropFilter||'none'};
});
}""")
assert len(lcd_glass)==11,lcd_glass
assert all(v['wellColor']=='rgb(2, 7, 11)' and
v['faceColor']=='rgb(1, 6, 10)' for v in lcd_glass),lcd_glass
assert all(v['inset'] and v['filter']=='none' and
v['blur']=='none' for v in lcd_glass),lcd_glass
assert all(v['width']==(30 if v['leds']==2 else 14) for v in lcd_glass),lcd_glass
# 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]
Expand Down
34 changes: 34 additions & 0 deletions web/styles-src/42-mixer-premium.css
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,37 @@ html:not([data-mixperf="baseline"]):not([data-mixperf="layers-off"]):not([data-m
#app #mixer .fader-zone .meter-signal-area .meter-peak{
left:2px;right:2px;
}

/* P0: common sleeping LCD material for all 10 CH + MASTER, regardless
of channel color, selected state, audio connection or live level.
Pure static inset paint: no CSS animation, filters, blur or new RAF. */
#app #mixer .fader-zone .vu-bank .vu-bars{
background-color:#02070b;
background-image:linear-gradient(90deg,#0b1a20 0%,#020609 13%,#010408 61%,#07131a 100%);
border:0;border-radius:5px;
box-shadow:inset 2px 0 3px #000a,inset -2px 0 3px #000a,
inset 0 3px 3px #000e,inset 0 -2px 2px #122a33;

}
#app #mixer .fader-zone .vu-bank .meter-unit .meter{
background-color:#01060a;
background-image:linear-gradient(90deg,#030c11,#010407 45%,#040e13);
border:0;border-radius:3px;
box-shadow:inset 1px 0 2px #000,inset -1px 0 2px #000,
inset 0 2px 3px #000e,inset 0 -1px 1px #18303a;

}
#app #mixer .fader-zone .vu-bank .meter-unit .meter::after{
inset:0;border:0;border-radius:3px;
background:linear-gradient(180deg,#e8ffff0c,transparent 30%);
}
#app #mixer .fader-zone .vu-bank .meter-signal-area{
background:#010509;border-radius:2px;
}
#app #mixer .fader-zone .vu-bank.is-mono .vu-bars{
flex:0 0 14px;min-width:14px;max-width:14px;width:14px;
}
#app #mixer .fader-zone .vu-bank.is-stereo .vu-bars,
#app #masterLeft .master-fader-zone .vu-bank .vu-bars{
flex:0 0 30px;min-width:30px;max-width:30px;width:30px;
}
Loading
Loading