diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 75d5e4fa2..3b838b34a 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -92,7 +92,7 @@ jobs: -DBUILD_TESTING=ON -DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps" - name: Build executable and native RT tests - run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixLiveChannelFxTests ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixShowSchemaTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2 + run: cmake --build build --config Release --target ARMixConsole ARMixFxOrderTests ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixPreparedMixerBlockTests ARMixLiveRoutingEpochTests ARMixJucePortMaskTests ARMixNativeMixerSessionTests ARMixNativeDrySendTests ARMixLiveChannelFxTests ARMixDedicatedAuxBusTests ARMixTenChannelLiveControlTests ARMixWorkspaceTests ARMixVaultTests ARMixBackupTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixShowSchemaTests ARMixShowStoreTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2 - name: Test realtime control primitives run: ctest --test-dir build -C Release --output-on-failure - name: Package verified JUCE GUI for hardware FAT diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index 5e817d8d8..5804c79ca 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -1296,6 +1296,54 @@ #app #scenesList .scene-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0} #app #scenesList .scene-delete{flex:0 0 20px;height:18px;padding:0;border:1px solid #53646d;border-radius:2px;background:#26343c;color:#d0dbdf;font-size:14px;line-height:14px} #app #scenesList .scene-delete:hover{background:#40515a} + +/* The mono meter has ONE LED slot, stereo/master TWO. Keep 7px fixed LEDs. */ +#app #mixer .fader-zone .vu-bank.is-mono{ + flex-basis:35px;width:35px;min-width:35px;max-width:35px; +} +#app #mixer .fader-zone .vu-bank.is-mono .vu-bars{ + flex-basis:14px;width:14px;min-width:14px;max-width:14px; +} +/* Same machined recessed folds as fader; no external rectangular stroke. */ +#app #mixer .fader-zone .vu-bank .vu-bars{ + position:relative;isolation:isolate;border:0;border-radius:5px;background:#24343c; + box-shadow:inset 0 4px 4px -3px #070e13,inset 0 -4px 4px -3px #070e13, + inset 4px 0 5px -4px #081116,inset -4px 0 5px -4px #081116; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter{ + border:0;border-radius:2px;background:#080f14; + box-shadow:inset 0 1px 2px #0009,inset 1px 0 2px #000c,inset -1px 0 2px #000b; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter::after{ + inset:0;background:linear-gradient(180deg,#d3eced10,transparent 35%); +} +/* LUFS / dBTP: exactly two lines in a black glass LCD. No blur/compositor. */ +#app #masterLeft .master-controls-zone .master-analysis{ + box-sizing:border-box;height:38px;min-height:38px;flex:0 0 38px; + display:flex;flex-direction:column;justify-content:center;gap:1px; + margin:0;padding:3px 6px;border:0;border-radius:4px; + background:linear-gradient(180deg,#0d1c1c,#030a0b 35%,#071313); + box-shadow:inset 0 3px 4px -2px #000,inset 2px 0 3px -2px #000, + inset -2px 0 3px -2px #000,inset 0 -1px 0 #40625c77; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row{ + display:flex;align-items:center;justify-content:space-between; + flex:0 0 14px;height:14px;min-height:14px;margin:0; + color:#70c2a1;font:600 9px/14px Consolas,monospace; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong{ + color:#58f3a0;font:700 12px/14px Consolas,monospace; + min-width:0;text-align:right;text-shadow:none; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong.over-limit{ + color:#ff555f;text-shadow:none; +} + +/* Borderless deep LED slit keeps the approved 10px illuminated cell width. */ +#app #mixer .fader-zone .meter-signal-area .meter-fill, +#app #mixer .fader-zone .meter-signal-area .meter-peak{ + left:2px;right:2px; +}
@@ -1616,7 +1664,7 @@
${i+1}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
TRIM
dB
${fmt(ch.trim)}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
${panText(ch.pan)}
-
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}
${meterScaleMarkup()}
${faderScaleMarkup()}
+
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}
${meterScaleMarkup()}
${faderScaleMarkup()}
${safeText(ch.name)}${safeText(ch.icon)}
`} function renderMixer(){ @@ -1646,10 +1694,9 @@ host.innerHTML=`
MASTER
${masterFxRows()}
-
-
STREAM LEVELS SIM
-
LUFS-I--
-
dBTP--
+
+
LUFS—
+
dBTP—
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/CMakeLists.txt b/CMakeLists.txt index b2d019f1c..cbf68550d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ juce_add_gui_app(ARMixConsole juce_add_binary_data(ARMixAssets SOURCES web/index.html web/styles.css web/app.js web/bridge.js web/monitor.js) -target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/PreparedMixerBlock.h engine/core/LiveChannelFxGraph.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h) +target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/AuxBusPlan.h engine/core/PreparedMixerBlock.h engine/core/LiveChannelFxGraph.h engine/core/PreparedNativeMixerSession.h engine/core/NativeDryRouteCommand.h engine/core/RealtimeRoutePublisher.h engine/device/LiveInputPortRegistry.h src/LiveDryRoutingLab.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/StudioBackup.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/NativeShowSchema.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/JuceActivePortSnapshot.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h) target_compile_definitions(ARMixConsole PRIVATE JUCE_WEB_BROWSER=1 JUCE_USE_WIN_WEBVIEW2=1 @@ -72,6 +72,9 @@ if(BUILD_TESTING) add_executable(ARMixTenChannelLiveControlTests tests/realtime_ten_channel_controls_test.cpp) target_compile_features(ARMixTenChannelLiveControlTests PRIVATE cxx_std_20) add_test(NAME P1ITenChannelLiveFaderPanMuteSoloAndStableFx COMMAND ARMixTenChannelLiveControlTests) + add_executable(ARMixDedicatedAuxBusTests tests/dedicated_aux_bus_test.cpp) + target_compile_features(ARMixDedicatedAuxBusTests PRIVATE cxx_std_20) + add_test(NAME P1KTenIndependentInputsAndFourDedicatedAuxReturns COMMAND ARMixDedicatedAuxBusTests) juce_add_console_app(ARMixLiveChannelFxTests PRODUCT_NAME "ArSonMix P1H Independent Channel FX Tests") target_sources(ARMixLiveChannelFxTests PRIVATE tests/live_channel_fx_graph_test.cpp engine/core/LiveChannelFxGraph.h) target_link_libraries(ARMixLiveChannelFxTests PRIVATE juce::juce_audio_processors juce::juce_recommended_config_flags) @@ -220,4 +223,10 @@ if(BUILD_TESTING) target_compile_features(ARMixShowSchemaTests PRIVATE cxx_std_20) add_test(NAME P4NativeShowSnapshotV2WireRoundTrip COMMAND ARMixShowSchemaTests) + juce_add_console_app(ARMixShowStoreTests PRODUCT_NAME "ArSonMix Native Studio Shows Generation Tests") + target_sources(ARMixShowStoreTests PRIVATE tests/native_show_store_test.cpp src/NativeShowStore.h src/NativeShowSchema.h) + target_link_libraries(ARMixShowStoreTests PRIVATE juce::juce_core juce::juce_cryptography juce::juce_recommended_config_flags) + target_compile_features(ARMixShowStoreTests PRIVATE cxx_std_20) + add_test(NAME P4ImmutableNativeShowsAndVendorStateRoundTrip COMMAND ARMixShowStoreTests) + endif() diff --git a/docs/P1K_TEN_INPUTS_FOUR_DEDICATED_AUX_20261029.md b/docs/P1K_TEN_INPUTS_FOUR_DEDICATED_AUX_20261029.md new file mode 100644 index 000000000..c49173a75 --- /dev/null +++ b/docs/P1K_TEN_INPUTS_FOUR_DEDICATED_AUX_20261029.md @@ -0,0 +1,28 @@ +# P1K — Ten permanently available INPUT lanes + FOUR dedicated AUX/FX RETURNS +**Base** `main@faee66f475cced8e97bb4e4726b153aa49b10607`: P1J stable vendor processor ownership, P1I realtime 10CH mixer GUI, P4 native ShowV2 wire validation, latest P0 GUI, full native port/epoch fences. The separate GUI optimization PR #133 is intentionally untouched. **This extends the existing live routing DSP**, not a new audio device thread or parallel mixer. + +## Meaningful behavior +The previous P1G/H routing compiled exactly 10 total strips: a reverb BUS occupied physical CH10 or another input. P1K adds **four dedicated AUX returns, indexed AUX1..AUX4, outside physical CH1..10**, each stereo with enable, gain, mute, MAIN output control, optional *independent* zero-latency stereo VST3 processor, and a realtime peak meter. All ten source strip inputs may still be assigned while all four AUX returns are active. This is an actual native callback path, not UI-preview. + +The existing `PreparedRenderGraph`, `PreparedMixerBlock`, `LiveChannelFxGraph`, `RealtimeRoutePublisher`, `LiveDryRoutingLab` and `NativeDryRouteCommand` remain the **single** engine. No code duplicates or resets Orbit, CH1 production VST host, 10CH real faders, P0 hardware testing, backup or GUIs. Existing internal channel→channel (legacy BUS) sends remain compatible for saved running sessions. New destinations 10–13 identify AUX1–AUX4 distinctly. New compiler validates enabled AUX, gain 0..4, explicit PRE/POST, source CH1..10, bounded send count, no duplicate tap edge, and each bus's valid identity before ACK. AUX cannot send back to INPUT/AUX, so no self-feedback or cycles by construction. + +DSP order each block: verified physical input(s) → channel-specific VST3 → PRE SEND (including dedicated AUX destinations) → realtime fader/PAN/mute/solo ramp → channel POST SEND → 4 dedicated AUX buffers → independent AUX stereo VST3 → AUX gain/mute/Master → MASTER. The P1J shared-internal ownership/graph revision remains unchanged: a selected AUX VST3 with same stable AUX slot + native catalog ID + hardware epoch/quantum is reused across route edits, not re-instantiated. Distinct AUX FX lifecycle is prepared off RT and plugin retirements occur only after reader leases. No new locks, callback allocations, or device reopen. AUX scratch is allocated only when an AUX is enabled (up to 8 * 8192 floats in addition to 10 strips), and all send coefficients / sorting / validation are compiled off RT. + +In `SIGNAL FLOW → OPEN ROUTING MATRIX`, a new **DEDICATED AUX / FX RETURNS** subsection allows choosing AUX enable, output MAIN, volume, plugin from trusted catalog. Send destination dropdown distinguishes CH 1..10 from AUX 1..4. Native accepted-route SSOT now includes `auxes` and the ACK carries `auxCount`, `auxSendCount`, `auxFxNames` and `auxPeaks`. Route editor reopens from accepted configuration + current live faders, never stale WebView UI state. The premium MAIN mixer strip layout, colors, Orbit button, FX rack and LCD are not touched. + +## FAT at real hardware +1. Use approved DIRECT ASIO/WASAPI, verified input mask, no independent clock. Explicitly MUTE OUTPUT and disable legacy CH1 VST chain before starting LAB. Never assume that JUCE opened ten capture ports simply because ten logical inputs exist. +2. `SIGNAL FLOW → OPEN ROUTING MATRIX`. Assign physical IN1…IN10 to CH1–CH10 *only if those ports are actually enabled in AUDIO SETUP*. Enable AUX1 for vocal reverb and AUX2 for another return. The CH1–CH10 assignments remain selectable at the same time. +3. Choose independent zero-latency stereo VST3 reverb on AUX1 and another plugin on AUX2 (or test dry first). Route CH1 PRE→AUX1, CH3 POST→AUX2. APPLY WHILE MUTED. Require native ACK `auxCount=2`, `auxSendCount=2`, `fxCount` matching selected strips/returns. +4. Unmute low-level headphones. Change fader CH1 to -inf: its PRE send remains audible but dry source silences. The POST send from CH3 must follow its fader. AUX volume/mute and MAIN toggle must affect only its independent return, not a source input. +5. MUTE, edit only a send and APPLY: native `fxReused` must include the unchanged AUX VST3. Trigger invalid destination (AUX disabled, unknown VST3, stale epoch, invalid gain or duplicate send): existing native topology remains active, no alternate input fallback. +6. Perform independent #15 zero-FX hardware crackle/clock test; no software CTest can establish zero dropouts at an actual DAC. + +## Deterministic test / acceptance +- Device-independent native CTest uses all ten actual physical sample arrays and two simultaneous AUX returns; verifies analytic sample multiplication through PRE/POST, output/master sums, aux mute and return FX taps, no RT allocations, invalid destinations, duplicate send, disabled AUX, rollback, and old no-AUX compatibility. +- JUCE native CTest executes **real `AudioProcessor::processBlock`** on a physical source and on a dedicated AUX with P1J stable shared FX instance through graph replacement (no prepare/release or state loss). +- Native command test validates `juce::var` JSON decoding/physical assignment, true bus id 10, invalid disabled AUX and rollback. +- Existing Windows CMake + same CI workflow test target `ARMixDedicatedAuxBusTests` and Node native GUI contract. Never merge until the exact PR SHA has green Windows full app/CTest/ZIP and Chromium. Reconcile changes from parallel UI PR #133 before merge. + +## Outstanding architecture gates — not misrepresented +This is **operator-opt-in** 10-input+4-AUX live Routing LAB, not fully integrated DAW-style production FX rack. Each strip and AUX has one stereo-compatible VST3, no multichannel plugin state snapshot restore or PDC, no AUX-to-AUX routing and **no dedicated physical AUX output** yet (all enabled AUX return to stereo MAIN). User still must MUTE while applying structural changes. Existing legacy BUS return within ten strip grid is retained for backward compatibility, but new dedicated AUX should be used instead. A full Studio One/Audition-style production console requires multi-insert rack per strip, AUX/CUE output patching, full Scene recall and hardware #15 qualification. Avoid merging outdated #115/#117 wholesale. diff --git a/docs/P4_NATIVE_SHOW_STORE_STAGE2_20261029.md b/docs/P4_NATIVE_SHOW_STORE_STAGE2_20261029.md new file mode 100644 index 000000000..cc306b4be --- /dev/null +++ b/docs/P4_NATIVE_SHOW_STORE_STAGE2_20261029.md @@ -0,0 +1,27 @@ +# P4 stage 2 — Native Studio/Shows transactional generation store + +**Status:** Engine-independent storage implementation; not yet wired to a live SAVE/RECALL button. + +## Source and boundaries +- `src/NativeShowStore.h` owns CONTROL/IO-thread `commit(show,snapshots,vendorBlobs)` and `load(showId)`. The application must call it with its normal `PortableWorkspace::dataRoot()` (already `Studio/` in portable mode). All files land under `Studio/Shows//`. +- Each save checks ShowV2/SnapshotV2 bounded schema and ordering, exactly ten stable strips, FX catalog IDs and SHA256 digest references. Every referenced vendor blob must be present and content-verified; no fabricated VST3 state. +- Save stages `show.json`, ordered `snapshots/.json`, immutable `blobs/.bin` in a separate directory, verifies the whole generation, renames into `versions/`, then commits a **single small HEAD** via JUCE TemporaryFile flush/replace. Failure before/at HEAD retains the previous HEAD; abandoned generations are not live. +- Load verifies the HEAD UUID, bounded metadata, every snapshot and every distinct referenced binary hash, then publishes outputs to the caller together. Corrupt/missing data leaves prior caller objects intact. Distinct blob hashes are verified once; total reader I/O and accepted commit size are capped. +- Policy caps per generation: 64 snapshots, 128 supplied blobs, 8 MiB per VST3 binary, 128 MiB of assembled data. This is deliberately narrower than the standalone schema limit of 256 snapshots. Future scalable manifests need paging before raising these limits. +- `StudioBackup` already enumerates all ordinary files in Studio, so each Show HEAD/generation is included in the same independent SHA256-verified USB backup. `tests/studio_backup_test.cpp` now asserts it. Browser cache and diagnostics remain excluded. + +## Failure and recovery notes +- Retired generations are kept for recovery; lifecycle pruning and disk quota UI still require a later implementation. An unsuccessful HEAD replacement may leave an orphan version which is not automatically loaded. +- JUCE stream flush plus same-directory temporary replacement is not a guarantee against every sudden power-loss sequence; verified journaling/OS fsync policies and Windows fault injection remain future production gates. +- Physical ports are **never activated** during load. No VST3 instance is instantiated. `BinaryState` must come from proper VST3 state capture on its permitted thread. Stored references alone do not prove that capture occurred. +- No live GUI Show list, native vendor capture, Orbit state restoration, native mixer recall, safes masking or device-epoch ACK is delivered by this stage. The legacy localStorage sidebar remains UI-only. #15 zero-plugin hardware crackle remains open. + +## Automated acceptance +- `tests/native_show_store_test.cpp` covers a real ten-strip snapshot with binary VST3 test bytes, immutable generation reuse, duplicate/missing snapshot rejection, bad binary hash, corruption rejection without modifying accepted outputs, and unsafe HEAD traversal refusal. +- This test is built and run with existing Windows MSVC+CTest pipeline; no parallel matrix or new publisher. Portable backup test additionally asserts native Shows are carried into the verified backup. +- Before merging: ensure exact-head native CI tests, usable artifact packaging, unchanged UI locks, and no RT callback changes. + +## Next native gates +1. P4 stage 3: capture the accepted P1J session and actual VST3 vendor state through correct control/main-thread affinity, with explicit unsupported-field masks (Orbit/HPF/Master FX etc.). Publish metadata read-only through the real native bridge. +2. P4 stage 4: preflight/re-map devices safely, stage new immutable graph with plugin states off callback, structural MUTE policy, ACK-gated activation, rollback and native safes/undo. Never silently apply physical ports on another PC. +3. Real Win11 ASIO/WASAPI hardware FAT, first-open WebView2 and Audio Setup at 100/125/150/175% DPI; physical output/GUI behavior matters more than CI-only synthetic tests. diff --git a/engine/core/AuxBusPlan.h b/engine/core/AuxBusPlan.h new file mode 100644 index 000000000..627938b97 --- /dev/null +++ b/engine/core/AuxBusPlan.h @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "ChannelSendPlan.h" +#include +#include +#include +#include + +// P1K: additional, dedicated stereo AUX/FX returns. These are NOT strips. +// The original 10 INPUT strips and their P1G internal channel-channel sends +// remain unchanged. AUX receives only from input strips (never an AUX), then +// returns only to MASTER. This one-way topology makes feedback impossible by +// construction. Everything validates/compiles on CONTROL, zero RT allocations. +namespace armix::mixer { +inline constexpr int auxBusCount=4; +inline constexpr int maxAuxSends=32; +struct AuxBusDefinition final { + bool enabled=false, toMaster=true, mute=false; + float gain=1.f; // linear 0..4, post AUX insert +}; +struct AuxSendDefinition final { + int source=-1; // INPUT 0..9, including existing internal returns + int destination=-1; // AUX index 0..3, never an INPUT index + SendTap tap=SendTap::postFader; + float gain=.25f, pan=0.f; + bool enabled=true; +}; +struct AuxBusRequest final { + std::array buses{}; + std::array sends{}; + int count=0; +}; +enum class AuxFault : std::uint8_t { + none, invalidCount, invalidBus, invalidStrip, disabledTarget, + invalidTap, invalidGain, invalidPan, duplicateSend +}; +struct AuxError final { + AuxFault fault=AuxFault::none; + int index=-1; +}; +struct AuxBusPlan final { + struct Edge { + int bus=-1; + SendTap tap=SendTap::postFader; + float leftGain=0.f,rightGain=0.f; + }; + std::array buses{}; + std::array edges{}; + std::array offset{}; + int edgeCount=0; + bool active=false; + + static bool compile(const AuxBusRequest& requested,AuxBusPlan& out,AuxError& error) noexcept { + error={}; + if(requested.count<0||requested.count>maxAuxSends){ + error={AuxFault::invalidCount,-1};return false; + } + AuxBusPlan candidate; + candidate.buses=requested.buses; + for(int b=0;b4.f){ + error={AuxFault::invalidGain,b};return false; + } + candidate.active|=bus.enabled; + } + std::array outgoing{}; + for(int i=0;i=stripCount){ + error={AuxFault::invalidStrip,i};return false; + } + if(s.destination<0||s.destination>=auxBusCount){ + error={AuxFault::invalidBus,i};return false; + } + if(s.tap!=SendTap::preFader && s.tap!=SendTap::postFader){ + error={AuxFault::invalidTap,i};return false; + } + if(!std::isfinite(s.gain)||s.gain<0.f||s.gain>1.f){ + error={AuxFault::invalidGain,i};return false; + } + if(!std::isfinite(s.pan)||s.pan< -1.f||s.pan>1.f){ + error={AuxFault::invalidPan,i};return false; + } + if(!s.enabled)continue; + if(!requested.buses[s.destination].enabled){ + error={AuxFault::disabledTarget,i};return false; + } + for(int j=0;j0.f?1.f-s.pan:1.f), + s.gain*(s.pan<0.f?1.f+s.pan:1.f)}; + } + out=candidate; + return true; + } + + // Unconditioned block-level send accumulation: caller owns mute/solo + // source policy and supplies channel scratch AFTER PRE gate / fader. + // Every destination is a dedicated, preallocated AUX stereo buffer. + void dispatch(int source,SendTap tap,const float* left,const float* right, + float* const* auxL,float* const* auxR,int frames) const noexcept { + if(!active||source<0||source>=stripCount||frames<=0||!left||!right|| + !auxL||!auxR)return; + for(int i=offset[source];i,channels>; + using FxBank=std::array,fxSlots>; explicit LiveChannelFxGraph(const PreparedRenderGraph& plan,int frames,int pluginQuantum=512) : block_(std::make_unique(plan,frames)), @@ -89,16 +90,16 @@ class LiveChannelFxGraph final { } const juce::String& insertName(int strip) const noexcept { static const juce::String empty; - return strip>=0&&strip=0&&stripname:empty; } const juce::String& insertId(int strip) const noexcept { static const juce::String empty; - return strip>=0&&strip=0&&stripcatalogId:empty; } const Processor* instanceProcessor(int strip) const noexcept { - return strip>=0&&strip=0&&stripprocessor.get():nullptr; } @@ -107,7 +108,7 @@ class LiveChannelFxGraph final { // same device epoch, sample-rate and prepared audio quantum. bool reuse(int strip,const LiveChannelFxGraph& previous, const juce::String& catalogId) { - if(strip<0||strip>=channels||catalogId.isEmpty()|| + if(strip<0||strip>=fxSlots||catalogId.isEmpty()|| processors_[strip]||!previous.processors_[strip]|| previous.insertId(strip)!=catalogId|| previous.pluginQuantum_!=pluginQuantum_)return false; @@ -118,7 +119,7 @@ class LiveChannelFxGraph final { bool install(int strip,std::unique_ptr processor, const juce::String& name,const juce::String& catalogId={}) { - if(strip<0||strip>=channels||!processor||processors_[strip]) + if(strip<0||strip>=fxSlots||!processor||processors_[strip]) return false; processors_[strip]=std::make_shared( std::move(processor),catalogId,name); @@ -132,7 +133,7 @@ class LiveChannelFxGraph final { float* left,float* right,int frames, RenderLevels* levels=nullptr) noexcept { auto channelFx=[this](int strip,float* l,float* r,int samples) noexcept { - if(strip<0||strip>=channels)return; + if(strip<0||strip>=fxSlots)return; auto* instance=processors_[strip].get(); // no shared_ptr copy in RT if(instance)instance->render(l,r,samples); }; diff --git a/engine/core/NativeDryRouteCommand.h b/engine/core/NativeDryRouteCommand.h index fe11e2529..dbce3185f 100644 --- a/engine/core/NativeDryRouteCommand.h +++ b/engine/core/NativeDryRouteCommand.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only #pragma once #include "ChannelSendPlan.h" +#include "AuxBusPlan.h" #include #include #include @@ -12,6 +13,7 @@ namespace armix::mixer { struct NativeDryRouteCommand final { ChannelRoutingConfig channels {}; SendRequest sends {}; + AuxBusRequest aux {}; static bool decode(const juce::var& request, NativeDryRouteCommand& destination, @@ -68,6 +70,33 @@ struct NativeDryRouteCommand final { problem="Channel must be NONE, MONO, STEREO or BUS";return false; } } + // Dedicated AUX 1..4 are independent from the ten physical INPUTs. + // Old sessions without auxes remain backward compatible and silent. + const auto rawAux=request.getProperty("auxes",juce::var()); + if(!rawAux.isVoid()){ + auto* auxRows=rawAux.getArray(); + if(!auxRows||auxRows->size()!=auxBusCount){ + problem="Exactly four dedicated AUX definitions are required"; + return false; + } + for(int b=0;bgetReference(b); + if(!row.isObject()){problem="Invalid AUX return";return false;} + const auto enabled=row.getProperty("enabled",false); + const auto master=row.getProperty("main",true); + const auto mute=row.getProperty("mute",false); + const auto level=row.getProperty("gain",1.0); + if(!enabled.isBool()||!master.isBool()||!mute.isBool()|| + !(level.isDouble()||level.isInt())){ + problem="Invalid AUX enable, main, mute or level";return false; + } + const float gain=static_cast(static_cast(level)); + if(!std::isfinite(gain)||gain<0.f||gain>4.f){ + problem="AUX gain must be 0..4";return false; + } + candidate.aux.buses[b]={bool(enabled),bool(master),bool(mute),gain}; + } + } const auto rawSends=request.getProperty("sends",juce::var()); if(!rawSends.isVoid() && !rawSends.isArray()){ problem="Sends must be an array";return false; @@ -94,10 +123,12 @@ struct NativeDryRouteCommand final { problem="Send tap must be PRE or POST";return false; } const int from=static_cast(source),to=static_cast(dest); - if(from<0||from>=stripCount||to<0||to>=stripCount){ - problem="Send channel outside 1..10";return false; + if(from<0||from>=stripCount||to<0||to>=stripCount+auxBusCount){ + problem="Send requires CH1..10 source and CH/AUX destination";return false; } - if(modeNames[from]=="NONE"||modeNames[to]=="NONE"){ + if(modeNames[from]=="NONE"|| + (to=stripCount&&!candidate.aux.buses[to-stripCount].enabled)){ problem="Enable a sender and set the recipient to BUS or an assigned channel";return false; } const float sendGain=static_cast(static_cast(gain)); @@ -106,10 +137,17 @@ struct NativeDryRouteCommand final { !std::isfinite(sendPan)||sendPan< -1.f||sendPan>1.f){ problem="Send level 0..1, pan -1..1";return false; } - auto& s=candidate.sends.sends[candidate.sends.count++]; - s.source=from;s.destination=to; - s.tap=tap=="PRE"?SendTap::preFader:SendTap::postFader; - s.gain=sendGain;s.pan=sendPan;s.enabled=true; + if(to>=stripCount){ + auto& s=candidate.aux.sends[candidate.aux.count++]; + s.source=from;s.destination=to-stripCount; + s.tap=tap=="PRE"?SendTap::preFader:SendTap::postFader; + s.gain=sendGain;s.pan=sendPan;s.enabled=true; + }else{ + auto& s=candidate.sends.sends[candidate.sends.count++]; + s.source=from;s.destination=to; + s.tap=tap=="PRE"?SendTap::preFader:SendTap::postFader; + s.gain=sendGain;s.pan=sendPan;s.enabled=true; + } } } // Rejection never mutates the destination. Explicit DAG validation diff --git a/engine/core/PreparedMixerBlock.h b/engine/core/PreparedMixerBlock.h index a27c49997..cadf0460e 100644 --- a/engine/core/PreparedMixerBlock.h +++ b/engine/core/PreparedMixerBlock.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only #pragma once #include "ChannelSendPlan.h" +#include "AuxBusPlan.h" #include #include #include @@ -19,17 +20,19 @@ namespace armix::mixer { enum class RenderFault : unsigned char { - none, invalidChannelRouting, invalidSendRouting + none, invalidChannelRouting, invalidSendRouting, invalidAuxRouting }; struct RenderError final { RenderFault fault = RenderFault::none; LayoutError channel {}; SendError sends {}; + AuxError aux {}; }; struct PreparedRenderGraph final { ChannelRoutingPlan channels {}; ChannelSendPlan sends {}; + AuxBusPlan aux {}; std::array audible {}; std::array scheduled {}; std::array leftGain {}; @@ -43,7 +46,8 @@ struct PreparedRenderGraph final { std::span callbackOrderedPhysicalPorts, const SendRequest& sendsRequest, PreparedRenderGraph& destination, - RenderError& error) noexcept { + RenderError& error, + const AuxBusRequest& requestedAux={}) noexcept { error = {}; PreparedRenderGraph candidate; if (!ChannelRoutingPlan::compile(routing, callbackOrderedPhysicalPorts, @@ -55,6 +59,10 @@ struct PreparedRenderGraph final { error.fault = RenderFault::invalidSendRouting; return false; } + if (!AuxBusPlan::compile(requestedAux,candidate.aux,error.aux)){ + error.fault=RenderFault::invalidAuxRouting; + return false; + } const auto& configs = routing.stripsAndMaster.strips; std::array ancestors {}; @@ -144,6 +152,7 @@ class RealtimeStripControls final { struct RenderLevels final { std::array channelPeak {}; + std::array auxPeak {}; float masterPeakL = 0.f, masterPeakR = 0.f; }; @@ -153,12 +162,13 @@ struct RenderLevels final { class PreparedMixerBlock final { public: // The maximum is an implementation bound, NOT an OS device promise. - // Allocations are constructor-only; 20 strip lanes + 2 master lanes. + // Allocations are constructor-only; 20 strip lanes + optional 8 AUX + 2 master. static constexpr int hardFrameLimit = 8192; PreparedMixerBlock(const PreparedRenderGraph& plan, int maxFrames) : plan_(plan), capacity_(maxFrames), backing_(validCapacity(maxFrames) - ? static_cast(stripCount*2+2)*maxFrames + ? static_cast(stripCount*2+2+ + (plan.aux.active?auxBusCount*2:0))*maxFrames : 0u, 0.f) { if (!validCapacity(maxFrames)) capacity_=0; @@ -169,6 +179,13 @@ class PreparedMixerBlock final { } masterL_=backing_.data()+static_cast(stripCount*2)*capacity_; masterR_=masterL_+capacity_; + if(plan.aux.active){ + for(int b=0;b(b*2)*capacity_; + auxRight_[b]=auxLeft_[b]+capacity_; + } + } } PreparedMixerBlock(const PreparedMixerBlock&)=delete; PreparedMixerBlock& operator=(const PreparedMixerBlock&)=delete; @@ -202,6 +219,11 @@ class PreparedMixerBlock final { PreparedRenderGraph const& graph=plan_; std::fill_n(masterL_,frames,0.f); std::fill_n(masterR_,frames,0.f); + if(graph.aux.active) + for(int b=0;bchannelPeak[strip]=peak; graph.sends.dispatch(strip,SendTap::postFader,l,r, left_.data(),right_.data(),frames); + graph.aux.dispatch(strip,SendTap::postFader,l,r, + auxLeft_.data(),auxRight_.data(),frames); + } + // Dedicated AUX returns execute AFTER all ten source strips. + // Input channel count NEVER decreases when an AUX is enabled. + // AUX FX IDs are stripCount+b; -1 remains MASTER FX callback. + if(graph.aux.active)for(int b=0;bauxPeak[b]=peak; } processFx(-1,masterL_,masterR_,frames); graph.channels.base.finishMaster(masterL_,masterR_,frames); @@ -328,6 +373,7 @@ class PreparedMixerBlock final { std::vector backing_; // ALLOCATED BEFORE callback, never resized std::array left_{}; std::array right_{}; + std::array auxLeft_{},auxRight_{}; std::array preGate_{},lastGainL_{},lastGainR_{}; std::array rampPrimed_{}; float* masterL_=nullptr; diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index cf76a8fc0..f237d0e08 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -820,7 +820,7 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback // Explicit message-thread transaction. NO VST is processed in this LAB. juce::String applyDryRoutingLab ( const juce::var& command, - const std::array& fx) { + const std::array& fx) { if (!isOutputMuted()) return "MUTE OUTPUT before applying physical DRY LAB routing"; if (handoff_.busy()) return "A VST3 graph handoff is in progress"; if (routeReconfiguring_.load(std::memory_order_acquire)) diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index 816234523..838077cd4 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -33,6 +33,8 @@ class LiveDryRoutingLab final { int uid=0; }; static constexpr int count=armix::mixer::stripCount; + static constexpr int auxCount=armix::mixer::auxBusCount; + static constexpr int fxSlots=count+auxCount; struct ChannelEdit { float linear=1.f, pan=0.f; bool mute=false, solo=false, mono=false; @@ -78,18 +80,21 @@ class LiveDryRoutingLab final { topologyFault_.store(false,std::memory_order_release); sendCount_.store(0,std::memory_order_relaxed); fxCount_.store(0,std::memory_order_relaxed); + auxCountActive_.store(0,std::memory_order_relaxed); + auxSendCount_.store(0,std::memory_order_relaxed); fxReused_.store(0,std::memory_order_relaxed); // Device lifecycle callback may run off the message thread. // acceptedRoute_ is a JUCE var owned by the CONTROL thread and must // never be mutated from the device thread. Epoch gates hide stale data. for(auto& p:channelPeaks_)p.store(0.f,std::memory_order_relaxed); + for(auto& p:auxPeaks_)p.store(0.f,std::memory_order_relaxed); peakL_.store(0.f,std::memory_order_relaxed); peakR_.store(0.f,std::memory_order_relaxed); } juce::String apply (const juce::var& command, bool directPermitted, bool independentClock, int loadedFx, - const std::array& selections, + const std::array& selections, juce::AudioPluginFormatManager& formats, double sampleRate,int deviceFrames) { // Called by the native message thread only. Not callable from RT. @@ -136,7 +141,7 @@ class LiveDryRoutingLab final { armix::mixer::RenderError error; if(!Plan::compile(topology, {physicalPorts.data(),static_cast(countNow)}, - sends,plan,error)) + sends,plan,error,decoded.aux)) return "Invalid physical routing (inactive port, format or mapping)"; const auto revision=expectedRevision+1; if(revision==0) return "Routing revision overflow"; @@ -165,11 +170,16 @@ class LiveDryRoutingLab final { // Never reuse across a device epoch or changed device quantum. const auto* prior=publisher_.controlPrepared(currentEpoch,expectedRevision); int insertCount=0,reusedCount=0; - for(int lane=0;laneprepared->reuse(lane,*prior,req.id)) { ++insertCount; ++reusedCount; @@ -179,7 +189,7 @@ class LiveDryRoutingLab final { return "Audio device sample rate or buffer size is invalid"; auto* fmt=formats.getFormat(0); if(!fmt || !fmt->fileMightContainThisPluginType(req.path)) - return "CH "+juce::String(lane+1)+": VST3 module is unavailable; rescan catalog"; + return label+": VST3 module is unavailable; rescan catalog"; juce::OwnedArray descriptions; fmt->findAllTypesForFile(descriptions,req.path); juce::PluginDescription* chosen=nullptr; @@ -187,31 +197,31 @@ class LiveDryRoutingLab final { if(item && item->uniqueId==req.uid && !item->isInstrument) {chosen=item;break;} if(!chosen) - return "CH "+juce::String(lane+1)+": selected VST3 effect identity not found (instrument plugins are unsupported)"; + return label+": selected VST3 effect identity not found (instrument plugins are unsupported)"; juce::String pluginError; auto instance=formats.createPluginInstance(*chosen,sampleRate, juce::jmax(32,deviceFrames),pluginError); if(!instance) - return "CH "+juce::String(lane+1)+": VST3 instantiation failed: "+pluginError; + return label+": VST3 instantiation failed: "+pluginError; const auto layoutError=armix::vst::prepareStereoEffectLayout(*instance); if(layoutError.isNotEmpty()) - return "CH "+juce::String(lane+1)+": "+layoutError; + return label+": "+layoutError; try { instance->prepareToPlay(sampleRate, juce::jmax(32,deviceFrames)); } catch(const std::exception& ex) { - return "CH "+juce::String(lane+1)+": plugin prepare failed: "+juce::String(ex.what()); + return label+": plugin prepare failed: "+juce::String(ex.what()); } catch(...) { - return "CH "+juce::String(lane+1)+": plugin prepare failed (unknown exception)"; + return label+": plugin prepare failed (unknown exception)"; } // Uncompensated latent inserts produce comb filtering in PRE/POST // sends. Until native PDC exists, reject instead of lying about // phase accuracy or silent extra buffer latency. if(instance->getLatencySamples()!=0) - return "CH "+juce::String(lane+1)+ + return label+ ": this VST3 reports latency; choose zero-latency mode until PDC is implemented"; if(!next->prepared->install(lane,std::move(instance),chosen->name,req.id)) - return "CH "+juce::String(lane+1)+": duplicate or invalid VST3 insert"; + return label+": duplicate or invalid VST3 insert"; ++insertCount; } const auto epochAtPublish=deviceEpoch_.load(std::memory_order_acquire); @@ -232,6 +242,14 @@ class LiveDryRoutingLab final { acceptedRoute_=command; channelEdits_=proposed; // control thread SSOT for this route revision for(int i=0;i(std::count_if(plan.aux.buses.begin(), + plan.aux.buses.end(), + [](const auto& b){return b.enabled;})), + std::memory_order_relaxed); + auxSendCount_.store(decoded.aux.count,std::memory_order_relaxed); return {}; case Publisher::Result::staleDevice: return "Device epoch changed during preparation"; @@ -284,7 +302,9 @@ class LiveDryRoutingLab final { fxCount_.store(0,std::memory_order_relaxed); fxReused_.store(0,std::memory_order_relaxed); acceptedRoute_=juce::var(); // control-thread STOP only + for(auto& n:auxFxNames_)n.clear(); for(auto& p:channelPeaks_)p.store(0.f,std::memory_order_relaxed); + for(auto& p:auxPeaks_)p.store(0.f,std::memory_order_relaxed); } void poll() noexcept {publisher_.pollRetirement();} // message thread bool active() const noexcept {return enabled_.load(std::memory_order_acquire);} @@ -307,6 +327,7 @@ class LiveDryRoutingLab final { float masterGain,bool masterMuted) noexcept { if(!active())return false; for(auto& p:channelPeaks_)p.store(0.f,std::memory_order_relaxed); + for(auto& p:auxPeaks_)p.store(0.f,std::memory_order_relaxed); // Stale meters must never survive a failed device/epoch mapping. peakL_.store(0.f,std::memory_order_relaxed); peakR_.store(0.f,std::memory_order_relaxed); @@ -355,6 +376,7 @@ class LiveDryRoutingLab final { const int max=snapshot->prepared->maxFramesPerPlugin(); float peakL=0.f,peakR=0.f; std::array perChannelPeaks{}; + std::array perAuxPeaks{}; for(int offset=0;offsetsetProperty("peakR",peakR_.load(std::memory_order_relaxed)); out->setProperty("sendCount",sendCount_.load(std::memory_order_relaxed)); out->setProperty("fxCount",fxCount_.load(std::memory_order_relaxed)); + out->setProperty("auxCount",auxCountActive_.load(std::memory_order_relaxed)); + out->setProperty("auxSendCount",auxSendCount_.load(std::memory_order_relaxed)); + juce::Array auxNames,auxPeaks; + for(int b=0;bsetProperty("auxFxNames",juce::var(auxNames)); + out->setProperty("auxPeaks",juce::var(auxPeaks)); out->setProperty("fxReused",fxReused_.load(std::memory_order_relaxed)); // Only the message thread calls status(), never the audio callback. if(active() && ready())out->setProperty("acceptedRoute",acceptedRoute_); @@ -456,6 +491,9 @@ class LiveDryRoutingLab final { Publisher publisher_; std::array channelEdits_{}; // JUCE message thread only std::array channelFxNames_{}; // status/control thread only + std::array auxFxNames_{}; // dedicated bus FX + std::array,auxCount> auxPeaks_{}; + std::atomic auxCountActive_{0},auxSendCount_{0}; juce::var acceptedRoute_; // native ACK only, no UI preview/localStorage truth // All data shared between JUCE device lifecycle and GUI/control reads // are atomic; the callback never enumerates masks or channel names. diff --git a/src/Main.cpp b/src/Main.cpp index 7174f6f59..b8483f31f 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; @@ -935,7 +960,7 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr // existing 1-channel VST3 production chain. Explicit Apply/Stop. if (action == "routingDryApply") { - std::array selected{}; + std::array selected{}; juce::String error; const auto rowsValue=value.getProperty("channels",juce::var()); auto* rows=rowsValue.getArray(); @@ -955,6 +980,25 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr selected[i]={entry->key(),entry->path,entry->name,entry->uid}; } } + // Dedicated AUX catalog IDs come only from the trusted native + // VST3 catalog, NEVER untrusted WebView file paths. + const auto auxValue=value.getProperty("auxes",juce::var()); + if(error.isEmpty() && !auxValue.isVoid()){ + auto* auxRows=auxValue.getArray(); + if(!auxRows||auxRows->size()!=LiveDryRoutingLab::auxCount) + error="Exactly four AUX returns are required"; + else for(int b=0;bgetReference(b).getProperty("fxId",{}).toString(); + if(id.isEmpty())continue; + const auto* entry=catalog_.find(id); + if(!entry){ + error="AUX "+juce::String(b+1)+": VST3 missing in catalog"; + break; + } + selected[LiveDryRoutingLab::count+b]= + {entry->key(),entry->path,entry->name,entry->uid}; + } + } if(error.isEmpty()) { try { error=engine_.applyDryRoutingLab(value,selected); @@ -1436,6 +1480,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/src/NativeShowStore.h b/src/NativeShowStore.h new file mode 100644 index 000000000..a64b62346 --- /dev/null +++ b/src/NativeShowStore.h @@ -0,0 +1,200 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "NativeShowSchema.h" +#include +#include +#include + +// P4 stage 2: CONTROL / I/O thread only. One immutable generation is prepared +// and verified before a single small HEAD file is atomically replaced. The +// audio callback NEVER sees this store. No device or VST3 is instantiated here. +namespace armix::shows { +struct BinaryState final { + juce::String sha256; + juce::MemoryBlock bytes; // caller captures vendor state on its valid thread +}; +class NativeShowStore final { +public: + static constexpr int maxSnapshotsPerCommit = 64; + static constexpr int maxBlobsPerCommit = 128; + static constexpr juce::int64 maxBlobBytes = 8 * 1024 * 1024; + static constexpr juce::int64 maxGenerationBytes = 128 * 1024 * 1024; + explicit NativeShowStore(juce::File studio) : root_(studio.getChildFile("Shows")) {} + + // Success is an empty string. Never change existing HEAD on any rejection. + juce::String commit(const ShowV2& show, + const std::vector& snapshots, + const std::vector& blobs) const { + if (!detail::uuid(show.id) || + snapshots.size()>maxSnapshotsPerCommit || + snapshots.size()!=show.snapshotOrder.size() || + blobs.size()>maxBlobsPerCommit) + return "Invalid Show identity or oversized generation"; + ShowV2 checkedShow; + const auto showJson=Codec::encode(show); + if(!Codec::decode(showJson,checkedShow)) return "Invalid ShowV2 metadata"; + std::vector payloads; + payloads.reserve(snapshots.size()); + for(size_t i=0;istatic_cast(maxBlobBytes) || + juce::SHA256(blob.bytes).toHexString()!=blob.sha256.toLowerCase()) + return "Vendor binary state hash or size invalid"; + total+=static_cast(blob.bytes.getSize()); + if(total>maxGenerationBytes) return "Generation exceeds 128 MB limit"; + } + // Every referenced VST3 state must be present. Once-only validated + // hashes are indexed for O(log B) lookup, not a nested linear scan + // across every channel/FX/snapshot at save time. + std::set suppliedHashes; + for(const auto& blob:blobs) + suppliedHashes.insert(blob.sha256.toLowerCase()); + for(const auto& snap:snapshots) + for(const auto& strip:snap.strips) + for(const auto& fx:strip.fx) + if(suppliedHashes.find(fx.stateSha256.toLowerCase())==suppliedHashes.end()) + return "Missing vendor state for "+fx.catalogId; + if(!root_.isDirectory() && root_.createDirectory().failed()) + return "Studio Shows directory is not writable"; + const auto showRoot=root_.getChildFile(show.id.toLowerCase()); + const auto versions=showRoot.getChildFile("versions"); + if(!versions.isDirectory()&&versions.createDirectory().failed()) + return "Show version directory is not writable"; + const auto generation=juce::Uuid().toDashedString().toLowerCase(); + if(!detail::uuid(generation)) return "Could not create generation ID"; + const auto stage=showRoot.getChildFile(".staging-"+generation); + if(stage.exists()) return "Staging generation already exists"; + if(stage.createDirectory().failed()) return "Cannot stage Show generation"; + struct Cleanup final { + juce::File dir; + ~Cleanup(){if(dir.exists())dir.deleteRecursively();} + } cleanup{stage}; + const auto snaps=stage.getChildFile("snapshots"); + const auto binary=stage.getChildFile("blobs"); + if(snaps.createDirectory().failed()||binary.createDirectory().failed()) + return "Cannot stage Show resources"; + if(!stage.getChildFile("show.json").replaceWithText(showJson)) + return "Cannot stage Show header"; + for(size_t i=0;i(blob.bytes.getSize()) || + !juce::SHA256(path).toHexString().equalsIgnoreCase(blob.sha256)) + return "Failed to stage and verify vendor binary"; + } + std::vector verified; + ShowV2 verifiedShow; + const auto verifyError=readFolder(stage,verifiedShow,verified); + if(verifyError.isNotEmpty() || verifiedShow.id!=show.id || + verified.size()!=snapshots.size()) return "Staged generation verification failed"; + // Directory rename does not replace an older version; the current + // generation changes ONLY when HEAD pointer commit succeeds. + const auto committed=versions.getChildFile(generation); + if(committed.exists()||!stage.moveFileTo(committed)) + return "Unable to publish immutable generation directory"; + // A failed HEAD write leaves previous generation intact; a new version + // may remain orphaned but will never be loaded without its HEAD. + juce::TemporaryFile temp(showRoot.getChildFile("HEAD")); + auto stream=temp.getFile().createOutputStream(); + if(!stream) return "Cannot open temporary Show pointer"; + if(!stream->writeText(generation+"\n",false,false,"\n")) + return "Cannot write temporary Show pointer"; + stream->flush(); + if(stream->getStatus().failed())return "Failed to flush Show pointer"; + stream.reset(); + if(!temp.overwriteTargetFileWithTemporary()) + return "Cannot atomically commit Show pointer"; + return {}; + } + + // Read-and-verify entire generation before changing either output value. + juce::String load(const juce::String& requestedId,ShowV2& show, + std::vector& snapshots) const { + if(!detail::uuid(requestedId))return "Invalid Show ID"; + const auto dir=root_.getChildFile(requestedId.toLowerCase()); + const auto head=dir.getChildFile("HEAD"); + if(!head.existsAsFile() || head.getSize()>128) return "Show pointer missing"; + const auto generation=head.loadFileAsString().trim(); + if(!detail::uuid(generation))return "Invalid Show pointer"; + ShowV2 candidate; + std::vector items; + const auto error=readFolder(dir.getChildFile("versions").getChildFile(generation), + candidate,items); + if(error.isNotEmpty())return error; + if(!candidate.id.equalsIgnoreCase(requestedId))return "Show identity mismatch"; + show=std::move(candidate); + snapshots=std::move(items); + return {}; + } + + juce::File currentGeneration(const juce::String& showId) const { + if(!detail::uuid(showId))return {}; + const auto base=root_.getChildFile(showId.toLowerCase()); + const auto head=base.getChildFile("HEAD"); + if(!head.existsAsFile()||head.getSize()>128)return {}; + const auto id=head.loadFileAsString().trim(); + return detail::uuid(id)?base.getChildFile("versions").getChildFile(id):juce::File{}; + } +private: + juce::File root_; + static bool validHash(const juce::String& s) { + if(s.length()!=64) return false; + for(const auto ch:s.toStdString()) + if(!((ch>='0'&&ch<='9')||(ch>='a'&&ch<='f')|| + (ch>='A'&&ch<='F')))return false; + return true; + } + static juce::String readFolder(const juce::File& dir,ShowV2& show, + std::vector& out) { + const auto header=dir.getChildFile("show.json"); + if(!header.existsAsFile()||header.getSize()>maxJsonBytes)return "Show JSON missing/oversized"; + ShowV2 tmp; + if(!Codec::decode(header.loadFileAsString(),tmp) || + tmp.snapshotOrder.size()>maxSnapshotsPerCommit)return "Invalid Show JSON"; + std::vector candidate; + juce::int64 total=header.getSize(); + std::set verifiedHashes; + for(const auto& id:tmp.snapshotOrder) { + const auto file=dir.getChildFile("snapshots").getChildFile(id.toLowerCase()+".json"); + if(!file.existsAsFile()||file.getSize()>maxJsonBytes)return "Snapshot JSON missing/oversized"; + SnapshotV2 snap; + if(!Codec::decode(file.loadFileAsString(),snap) || + !snap.id.equalsIgnoreCase(id))return "Invalid snapshot metadata"; + total+=file.getSize(); + if(total>maxGenerationBytes)return "Generation too large"; + for(const auto& strip:snap.strips) + for(const auto& fx:strip.fx) { + if(!validHash(fx.stateSha256))return "Unsafe state hash"; + const auto file=dir.getChildFile("blobs").getChildFile(fx.stateSha256.toLowerCase()+".bin"); + if(!file.existsAsFile()||file.getSize()>maxBlobBytes) + return "Missing/oversized vendor state"; + // Count and hash every unique immutable blob once, even if + // many FX snapshots intentionally reference the same state. + if(verifiedHashes.insert(fx.stateSha256.toLowerCase()).second) { + total+=file.getSize(); + if(total>maxGenerationBytes) return "Generation exceeds read budget"; + if(!juce::SHA256(file).toHexString().equalsIgnoreCase(fx.stateSha256)) + return "Vendor binary hash mismatch"; + } + } + candidate.push_back(std::move(snap)); + } + show=std::move(tmp);out=std::move(candidate);return {}; + } +}; +} // namespace armix::shows diff --git a/tests/dedicated_aux_bus_test.cpp b/tests/dedicated_aux_bus_test.cpp new file mode 100644 index 000000000..1d519d926 --- /dev/null +++ b/tests/dedicated_aux_bus_test.cpp @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#include "../engine/core/PreparedMixerBlock.h" +#if defined(NDEBUG) +#undef NDEBUG +#endif +#include +#include +#include +#include +#include +#include +using namespace armix::mixer; + +static std::atomic allocations{0}; +void* operator new(std::size_t n){ + allocations.fetch_add(1,std::memory_order_relaxed); + if(void* p=std::malloc(n?n:1))return p; + throw std::bad_alloc(); +} +void operator delete(void* p) noexcept {std::free(p);} +void operator delete(void* p,std::size_t) noexcept {std::free(p);} +static bool near(float a,float b){return std::abs(a-b)<.0003f;} +int main(){ + static_assert(stripCount==10 && auxBusCount==4); + constexpr int frames=8; + ChannelRoutingConfig cfg; + std::array activePorts{}; + for(int ch=0;ch,stripCount> signal{}; + std::array input{}; + for(int ch=0;ch outL{},outR{}; + RenderLevels meters; + std::array fxInvocations{}; + auto effects=[&](int strip,float* l,float* r,int n) noexcept { + if(strip>=stripCount&&strip(plan,32,32); + auto dry=std::make_unique(2.f); + auto wet=std::make_unique(3.f); + dry->prepareToPlay(48000,32); + wet->prepareToPlay(48000,32); + assert(fx->install(0,std::move(dry),"CH1","source-vst3")); + assert(fx->install(stripCount,std::move(wet),"AUX1","aux-vst3")); + assert(fx->activeInserts()==2); + const auto* originalBus=fx->instanceProcessor(stripCount); + RenderLevels levels; + const auto before=heapCalls.load(std::memory_order_relaxed); + assert(fx->process(phys,3,l.data(),r.data(),4,&levels)); + assert(heapCalls.load(std::memory_order_relaxed)==before); + assert(near(l[0],1.2f)&&near(r[0],1.2f)); + assert(near(levels.auxPeak[0],1.2f)); + auto second=std::make_unique(plan,32,32); + assert(second->reuse(0,*fx,"source-vst3")); + assert(second->reuse(stripCount,*fx,"aux-vst3")); + assert(second->instanceProcessor(stripCount)==originalBus); + assert(!second->reuse(stripCount,*fx,"wrong-id")); + const int oldPrepared=GainFx::prepared,oldReleased=GainFx::released; + fx.reset(); // AUX processor must remain live in second graph + assert(GainFx::released==oldReleased); + assert(second->process(phys,3,l.data(),r.data(),4,&levels)); + assert(near(l[0],1.2f)); + assert(GainFx::prepared==oldPrepared); + second.reset(); + assert(GainFx::released==oldReleased+2); + assert(GainFx::living==0); + } // Tests above use a real JUCE AudioProcessor processing seam. Vendor // VST3 formats and sound quality require separate Windows hardware FAT. } diff --git a/tests/live_routing_ui_contract_test.mjs b/tests/live_routing_ui_contract_test.mjs index 6904dee78..3e0709be5 100644 --- a/tests/live_routing_ui_contract_test.mjs +++ b/tests/live_routing_ui_contract_test.mjs @@ -82,13 +82,14 @@ test("P1G is real native BUS/send, not a cosmetic routing picker",()=>{ assert.match(ui,/arAddSend/); assert.match(ui,/data-send-tap/); assert.match(ui,/sends:draftSends\.map/); - assert.match(ui,/result\.sendCount/); + assert.match(ui,/result\.auxSendCount/); + assert.match(ui,/d\.sendCount/); assert.match(ui,/data-route-peak/); }); test("P1H independently instantiates and processes real JUCE FX in 10 native lanes",()=>{ const fx=readFileSync(new URL("../engine/core/LiveChannelFxGraph.h",import.meta.url),"utf8"); - assert.match(fx,/std::array,channels>/); + assert.match(fx,/std::array,fxSlots>/); assert.match(fx,/processor->processBlock\(buffer,midi\)/); assert.match(fx,/processor->releaseResources\(\)/); assert.match(lab,/std::make_unique\(plan/); @@ -148,3 +149,29 @@ test("P1J keeps real per-strip VST3 identity and tails across routing-only APPLY assert.match(app,/Independent VST3/); assert.match(ui,/NATIVE ACK:.*preserved/); }); + +test("P1K truly keeps ten physical INPUT strips and adds four independent native AUX/FX returns",()=>{ + const aux=readFileSync(new URL("../engine/core/AuxBusPlan.h",import.meta.url),"utf8"); + const block=readFileSync(new URL("../engine/core/PreparedMixerBlock.h",import.meta.url),"utf8"); + const fx=readFileSync(new URL("../engine/core/LiveChannelFxGraph.h",import.meta.url),"utf8"); + const command=readFileSync(new URL("../engine/core/NativeDryRouteCommand.h",import.meta.url),"utf8"); + const app=readFileSync(new URL("../web/monitor.js",import.meta.url),"utf8"); + assert.match(aux,/auxBusCount=4/); + assert.match(aux,/source<0\|\|s\.source>=stripCount/); + assert.match(aux,/destination<0\|\|s\.destination>=auxBusCount/); + assert.match(block,/processFx\(stripCount\+b,l,r,frames\)/); + assert.match(block,/graph\.aux\.dispatch\(strip,SendTap::preFader/); + assert.match(block,/graph\.aux\.dispatch\(strip,SendTap::postFader/); + assert.match(fx,/fxSlots=stripCount\+auxBusCount/); + assert.match(lab,/decoded\.aux/); + assert.match(lab,/auxSendCount_/); + assert.match(main,/LiveDryRoutingLab::auxCount/); + assert.match(command,/to>=stripCount/); + assert.match(app,/data-aux-row/); + assert.match(app,/auxes:draftAux\.map/); + assert.match(app,/data-aux-fx/); + const cmake=readFileSync(new URL("../CMakeLists.txt",import.meta.url),"utf8"); + const workflow=readFileSync(new URL("../.github/workflows/p1-windows.yml",import.meta.url),"utf8"); + assert.match(cmake,/P1KTenIndependentInputsAndFourDedicatedAuxReturns/); + assert.match(workflow,/ARMixDedicatedAuxBusTests/); +}); 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/native_dry_route_command_test.cpp b/tests/native_dry_route_command_test.cpp index f53837bbe..ea86b85d1 100644 --- a/tests/native_dry_route_command_test.cpp +++ b/tests/native_dry_route_command_test.cpp @@ -64,6 +64,40 @@ int main(){ invalid=juce::JSON::parse(json.replace("\"gain\":0.5","\"gain\":999")); assert(!NativeDryRouteCommand::decode(invalid,decoded,error)); assert(decoded.sends.count==2); + // P1K native JSON: AUX1 is an additional stereo return (index 10), + // not one of the 10 physical/BUS channel rows. Resolve by native index. + auto dedicated=juce::JSON::parse(json); + juce::Array auxRows; + for(int b=0;b(); + bus->setProperty("enabled",b==0); + bus->setProperty("main",true); + bus->setProperty("mute",false); + bus->setProperty("gain",1.0); + auxRows.add(juce::var(bus.release())); + } + dedicated.getDynamicObject()->setProperty("auxes",juce::var(auxRows)); + const auto rawSends=dedicated.getProperty("sends",juce::var()); + assert(rawSends.isArray()); + rawSends.getArray()->getReference(0).getDynamicObject()->setProperty("to",10); + assert(NativeDryRouteCommand::decode(dedicated,decoded,error)); + assert(decoded.aux.count==1&&decoded.sends.count==1); + assert(decoded.aux.sends[0].destination==0); + assert(decoded.aux.sends[0].tap==SendTap::preFader); + assert(PreparedRenderGraph::compile( + decoded.channels,ports,decoded.sends,graph,fault,decoded.aux)); + PreparedMixerBlock dedicatedBlock(graph,64); + assert(dedicatedBlock.process(inputs,3,l.data(),r.data(),2,noFx)); + assert(near(l[0],.5f)&&near(r[0],.5f)); // AUX PRE audible at CH1 -inf + // Invalid destination or disabled AUX must fail with unchanged result. + auxRows.getReference(0).getDynamicObject()->setProperty("enabled",false); + assert(!NativeDryRouteCommand::decode(dedicated,decoded,error)); + assert(decoded.aux.count==1); + auxRows.getReference(0).getDynamicObject()->setProperty("enabled",true); + rawSends.getArray()->getReference(0).getDynamicObject()->setProperty("to",14); + assert(!NativeDryRouteCommand::decode(dedicated,decoded,error)); + assert(decoded.aux.count==1); + // Older native commands still decode; AUX remains off by default. // Legacy command without "sends" remains backwards compatible. auto legacy=juce::JSON::parse(json.upToFirstOccurrenceOf(",\"sends\"",false,false)+"}"); assert(NativeDryRouteCommand::decode(legacy,decoded,error)); diff --git a/tests/native_show_store_test.cpp b/tests/native_show_store_test.cpp new file mode 100644 index 000000000..19305f7ac --- /dev/null +++ b/tests/native_show_store_test.cpp @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#ifdef NDEBUG + #undef NDEBUG +#endif +#include +#include +#include "../src/NativeShowStore.h" + +int main() { + using namespace armix::shows; + const auto base=juce::File::getSpecialLocation(juce::File::tempDirectory) + .getNonexistentChildFile("ArSonMixShowGenerationUnit","",false); + const auto workspace=base.getChildFile("Studio"); + assert(workspace.createDirectory().wasOk()); + NativeShowStore store(workspace); + // JUCE's toString() emits 32 hex digits; wire/storage UUIDs require + // 36-character RFC 4122 dashed identifiers. Guard that API contract. + assert(!detail::uuid(juce::Uuid().toString())); + assert(detail::uuid(juce::Uuid().toDashedString())); + + ShowV2 show; + show.id="11111111-2222-4333-8444-555555555555"; + show.name="Stage Live 01"; + show.createdMs=1761700000000LL; + show.modifiedMs=show.createdMs+1000; + const juce::String snapshotId="aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee"; + show.snapshotOrder={snapshotId}; + show.currentSnapshotId=snapshotId; + show.channelSafes[3]=true; + SnapshotV2 snap; + snap.id=snapshotId;snap.name="Soundcheck"; + snap.createdMs=show.createdMs;snap.modifiedMs=show.modifiedMs; + snap.strips[0].source=2; + snap.strips[0].inputA=2;snap.strips[0].inputB=5; + BinaryState blob; + const char bytes[]={'a','r','m','i','x',0,1,2,'\0'}; + blob.bytes.append(bytes,sizeof(bytes)); + blob.sha256=juce::SHA256(blob.bytes).toHexString(); + snap.strips[0].fx.push_back({"TestVendor|195",195,blob.sha256,false}); + std::vector snapshots={snap}; + std::vector blobs={blob}; + const auto firstCommitError=store.commit(show,snapshots,blobs); + if(firstCommitError.isNotEmpty()) std::cerr<<"initial Show commit failed: "< retrieved; + assert(store.load(show.id,loaded,retrieved).isEmpty()); + assert(loaded.channelSafes[3]); + assert(retrieved.size()==1 && retrieved[0].strips[0].inputB==5); + assert(retrieved[0].strips[0].fx[0].stateSha256==blob.sha256); + + // Bad/missing binary fails entirely without touching HEAD. + auto badBlob=blobs; + badBlob[0].bytes.append("CORRUPT",7); + assert(store.commit(show,snapshots,badBlob).isNotEmpty()); + assert(store.currentGeneration(show.id)==first); + + // Prepared show cannot reference snapshots not in the transaction. + ShowV2 badShow=show; + badShow.snapshotOrder.clear(); + assert(store.commit(badShow,snapshots,blobs).isNotEmpty()); + assert(store.currentGeneration(show.id)==first); + + // Valid newer generation commits exactly one pointer and retains old. + snapshots[0].name="Performance Ready"; + show.modifiedMs+=1000; + snapshots[0].modifiedMs+=1000; + assert(store.commit(show,snapshots,blobs).isEmpty()); + const auto second=store.currentGeneration(show.id); + assert(second!=first && second.isDirectory() && first.isDirectory()); + assert(store.load(show.id,loaded,retrieved).isEmpty()); + assert(retrieved[0].name=="Performance Ready"); + + // Missing/corrupt payload never partially replaces the accepted outputs. + const auto vendor=second.getChildFile("blobs").getChildFile(blob.sha256+".bin"); + assert(vendor.appendText("damaged")); + assert(store.load(show.id,loaded,retrieved).isNotEmpty()); + assert(retrieved.size()==1&&retrieved[0].name=="Performance Ready"); + + // Bad HEAD rejected before using unsafe path; backup remains intact. + auto head=workspace.getChildFile("Shows").getChildFile(show.id).getChildFile("HEAD"); + assert(head.replaceWithText("../unsafe")); + assert(store.load(show.id,loaded,retrieved).isNotEmpty()); + assert(store.currentGeneration(show.id)==juce::File{}); + assert(first.isDirectory()); + base.deleteRecursively(); + std::cout<<"PASS: immutable Shows generation, staged VST3 hash, atomic HEAD, no partial recovery\n"; + return 0; +} diff --git a/tests/studio_backup_test.cpp b/tests/studio_backup_test.cpp index 4c55c78d3..68755e7c1 100644 --- a/tests/studio_backup_test.cpp +++ b/tests/studio_backup_test.cpp @@ -28,6 +28,12 @@ int main() assert (plugin.replaceWithText ("Fake bundled FX bytes")); assert (sound.replaceWithText ("vendor state stub")); assert (cache.replaceWithText ("DO NOT BACKUP CACHE")); + // Native P4 Shows stay inside Studio and must be in verified USB backup. + const auto showPointer = studio.getChildFile ( + "Shows/11111111-2222-4333-8444-555555555555/HEAD"); + assert (showPointer.getParentDirectory().createDirectory().wasOk()); + assert (showPointer.replaceWithText ("aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee")); + assert (studio.getChildFile ("plugin-catalog.json").replaceWithText ("{\"items\":[]}")); assert (!st::StudioBackup::create (exe, studio, studio).ok()); // no recursion into source @@ -42,6 +48,9 @@ int main() .loadFileAsString() == plugin.loadFileAsString()); assert (copy.folder.getChildFile ("Studio/presets/Vocal Live.armix") .loadFileAsString() == sound.loadFileAsString()); + assert (copy.folder.getChildFile ( + "Studio/Shows/11111111-2222-4333-8444-555555555555/HEAD") + .loadFileAsString() == showPointer.loadFileAsString()); assert (!copy.folder.getChildFile ("Studio/Cache/WebView2/deletable-cache").exists()); const auto manifest = juce::JSON::parse ( copy.folder.getChildFile ("backup-manifest.json").loadFileAsString()); diff --git a/tests/ui_smoke.py b/tests/ui_smoke.py index 454d19266..11cfff9f0 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' @@ -895,6 +937,14 @@ def same_rect(a,b): assert mono_text['color']=='rgb(20, 16, 20)' and mono_text['shadow']=='none',mono_text await page.locator('#masterMode').click() assert await page.locator('#masterMode').inner_text()=='STEREO' + # Manual peak-hold reset must be deterministic: cancel the browser's + # unrelated 25Hz demo producer before injecting explicit levels. Without + # this, a live demo RAF can repopulate peakHold after RESET and make the + # test flaky on slower CI hosts. Production native metering is untouched. + await page.evaluate("""()=>{ + if(meterTimer){clearTimeout(meterTimer);meterTimer=0} + if(meterRAF){cancelAnimationFrame(meterRAF);meterRAF=0} + }""") await page.evaluate('updateMeterVisual("6L",99,performance.now())') assert await page.locator('[data-clip="6L"]').evaluate('(e)=>e.classList.contains("latched")') await page.locator('[data-clip="6L"]').click() 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('')}
TRIM
dB
${fmt(ch.trim)}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
${panText(ch.pan)}
-
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}
${meterScaleMarkup()}
${faderScaleMarkup()}
+
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}
${meterScaleMarkup()}
${faderScaleMarkup()}
${safeText(ch.name)}${safeText(ch.icon)}
`} function renderMixer(){ @@ -300,10 +300,9 @@ function renderMaster(){ host.innerHTML=`
MASTER
${masterFxRows()}
-
-
STREAM LEVELS SIM
-
LUFS-I--
-
dBTP--
+
+
LUFS—
+
dBTP—
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/web/monitor.js b/web/monitor.js index 04e869cc4..ba1cf8ece 100644 --- a/web/monitor.js +++ b/web/monitor.js @@ -35,7 +35,8 @@ "#arRouteRows{overflow-x:auto}.arRouteRow{min-width:590px}#arRouteSends{margin-top:12px}#arRouteSends h3{font-size:12px;margin:8px 0;color:#b1d4dd}.arSendRow{display:grid;grid-template-columns:1fr 1fr 76px 83px 32px;gap:6px;margin-bottom:5px}.arSendRow select{width:100%;min-width:0;padding:6px;color:#e1eef5;background:#0d202b;border:1px solid #4d6879;border-radius:4px}.arSendRow button{border:1px solid #9a6060;background:#442930;color:#f3dadd;border-radius:4px}#arAddSend{font-size:10px;padding:6px 8px}" + ".arRouteFoot{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:12px}.arRouteFoot button,.arRouteClose{color:#f0f7fa;background:#24475a;border:1px solid #587f91;border-radius:4px;padding:8px 12px;cursor:pointer}" + "#arRouteApply{background:#237566;border-color:#4ba48d}#arRouteStop{background:#50343c;border-color:#a8717c}" + - "#arRouteFeedback{font-size:11px;min-height:18px;color:#8bdec1;margin-top:10px}"; + "#arRouteFeedback{font-size:11px;min-height:18px;color:#8bdec1;margin-top:10px}" + + ".arAuxRow{display:grid;grid-template-columns:64px 52px 90px 70px 1fr;align-items:center;gap:7px;padding:7px;background:#0c202b;border-bottom:1px solid #36515f;font-size:11px}.arAuxRow label{display:flex;gap:4px;align-items:center}.arAuxRow select{min-width:0;width:100%;background:#0c202b;color:#dcecf3;border:1px solid #496b7a;padding:6px;border-radius:4px}#arAuxReturns h3{font-size:12px;color:#b1d4dd;margin:14px 0 8px}#arAuxReturns p{color:#90afbc;font-size:10px;margin:4px 0 7px}"; document.head.appendChild(css); // Signal Check is declared in the permanent toolbar; footer holds status only. const overlay = document.createElement("div"); @@ -71,11 +72,12 @@ '

ArSonMix · Live Input Routing LAB

Reading actual device ports...
' + '

Real hardware routing test: independent stereo-compatible VST3 insert per channel, PRE/POST sends, and BUS returns. No portable route recall. Use headphones at LOW volume. ' + 'The normal CH1 VST3 host resumes after STOP. Every port shown is from the device active input mask.

' + - '

INTERNAL SENDS · PRE / POST FADER (MAX 32)

' + + '

4 DEDICATED AUX / FX RETURNS · INPUT CH1–10 REMAIN AVAILABLE

Each AUX has a separate stereo return, VST3, level and MASTER routing. PRE/POST sends may target AUX1–4 without consuming CH strips.

INTERNAL SENDS · PRE / POST FADER (MAX 32)

' + '
Select channels, BUS returns and sends; APPLY is a native graph transaction.
' + '
'; document.body.appendChild(routeOverlay); const draftRoutes=Array.from({length:10},()=>({mode:"NONE",left:-1,right:-1,gain:0.25,pan:0,main:true,mute:false,solo:false,fxId:""})); + const draftAux=Array.from({length:4},()=>({enabled:false,gain:1,main:true,mute:false,fxId:""})); const draftSends=[]; let draftEpoch=0; // identity of the hardware used to draw these selectors function invalidateDraftForNewDevice(nextEpoch){ @@ -85,6 +87,7 @@ route.mode="NONE";route.left=-1;route.right=-1;route.gain=0.25;route.pan=0; route.main=true;route.mute=false;route.solo=false;route.fxId=""; } + for(const b of draftAux){b.enabled=false;b.gain=1;b.main=true;b.mute=false;b.fxId="";} draftSends.length=0; return true; } @@ -125,6 +128,9 @@ if(Object.prototype.hasOwnProperty.call(source,key)) draftRoutes[i][key]=source[key]; } + if(Array.isArray(saved.auxes)&&saved.auxes.length===4) + for(let b=0;b<4;b++)for(const key of ["enabled","gain","main","mute","fxId"]) + if(Object.prototype.hasOwnProperty.call(saved.auxes[b]||{},key))draftAux[b][key]=saved.auxes[b][key]; draftSends.length=0; if(Array.isArray(saved.sends)) for(const send of saved.sends.slice(0,32)) @@ -187,9 +193,27 @@ row.querySelector('[data-route-fx]').addEventListener('change',e=>{model.fxId=e.target.value;}); refreshMode(row); }); + drawAux(); drawSends(); updateRouteLabIdentity(); } + function drawAux(){ + const parent=document.getElementById("arAuxRows"); + parent.innerHTML=draftAux.map((bus,i)=>'
'+ + 'AUX '+(i+1)+''+ + ''+ + ''+ + ''+ + ''+ + '
').join(''); + parent.querySelectorAll('[data-aux-row]').forEach(row=>{ + const bus=draftAux[Number(row.dataset.auxRow)]; + row.querySelector('[data-aux-enable]').addEventListener('change',e=>{bus.enabled=e.target.checked;}); + row.querySelector('[data-aux-gain]').addEventListener('change',e=>{bus.gain=Number(e.target.value);}); + row.querySelector('[data-aux-main]').addEventListener('change',e=>{bus.main=e.target.checked;}); + row.querySelector('[data-aux-fx]').addEventListener('change',e=>{bus.fxId=e.target.value;}); + }); + } function refreshMode(row){ const type=row.querySelector('[data-route-mode]').value; row.querySelector('[data-route-left]').disabled=type==="NONE"||type==="BUS"; @@ -198,11 +222,12 @@ function drawSends(){ const el=document.getElementById("arSendRows"); const channels=Array.from({length:10},(_,i)=>''); - const channelSelect=(value)=>channels.map((option,i)=>option.replace(''')); + const listSelect=(options,value)=>options.map((option,i)=>option.replace(' '
'+ - ''+ - ''+ + ''+ + ''+ ''+ ''+ @@ -229,7 +254,7 @@ if(!label)return; setTextIfChanged(label,(d.active ? (d.ready?"DRY LAB ACTIVE":"DRY LAB STALE — SILENT, REAPPLY"):"DRY LAB OFF")+ " · device epoch "+(d.epoch||0)+" · rev "+(d.revision||0)+ - " · "+(d.ports?.length||0)+" enabled inputs · "+(d.outputPorts?.length||0)+" outputs · "+(d.sendCount||0)+" live sends"); + " · "+(d.ports?.length||0)+" enabled inputs · "+(d.outputPorts?.length||0)+" outputs · "+(d.sendCount||0)+" channel sends · "+(d.auxSendCount||0)+" AUX sends · "+(d.auxCount||0)+" AUX"); } function openRoutingLab(){ hydrateAcceptedRoute(); @@ -259,6 +284,7 @@ api.emitEvent("arMixAction",{action:"routingDryApply",value:{ deviceEpoch:draftEpoch,revision:Number(d.revision)||0, channels:draftRoutes.map(c=>({...c})), + auxes:draftAux.map(b=>({...b})), sends:draftSends.map(s=>({...s})) }}); }); @@ -268,7 +294,7 @@ if(result && typeof result==="object" && "epoch" in result)state.dryRoutingLab=result; document.getElementById("arRouteFeedback").textContent= reply?.ok===false?("REJECTED · "+(reply.error||"Invalid route")): - result.active?"NATIVE ACK: "+(result.fxCount||0)+" VST3 ("+(result.fxReused||0)+" preserved) · "+(result.sendCount||0)+" SENDS · UNMUTE OUTPUT in SIGNAL CHECK":"NATIVE ACK: STOPPED · output remains MUTED for safety"; + result.active?"NATIVE ACK: "+(result.fxCount||0)+" VST3 ("+(result.fxReused||0)+" preserved) · "+(result.auxCount||0)+" dedicated AUX · "+(result.auxSendCount||0)+" AUX sends · UNMUTE OUTPUT in SIGNAL CHECK":"NATIVE ACK: STOPPED · output remains MUTED for safety"; updateRouteLabIdentity(); }); diff --git a/web/styles-src/42-mixer-premium.css b/web/styles-src/42-mixer-premium.css index 0d9a4a511..fc3650a47 100644 --- a/web/styles-src/42-mixer-premium.css +++ b/web/styles-src/42-mixer-premium.css @@ -320,3 +320,51 @@ html:not([data-mixperf="baseline"]):not([data-mixperf="layers-off"]):not([data-m #app #scenesList .scene-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0} #app #scenesList .scene-delete{flex:0 0 20px;height:18px;padding:0;border:1px solid #53646d;border-radius:2px;background:#26343c;color:#d0dbdf;font-size:14px;line-height:14px} #app #scenesList .scene-delete:hover{background:#40515a} + +/* The mono meter has ONE LED slot, stereo/master TWO. Keep 7px fixed LEDs. */ +#app #mixer .fader-zone .vu-bank.is-mono{ + flex-basis:35px;width:35px;min-width:35px;max-width:35px; +} +#app #mixer .fader-zone .vu-bank.is-mono .vu-bars{ + flex-basis:14px;width:14px;min-width:14px;max-width:14px; +} +/* Same machined recessed folds as fader; no external rectangular stroke. */ +#app #mixer .fader-zone .vu-bank .vu-bars{ + position:relative;isolation:isolate;border:0;border-radius:5px;background:#24343c; + box-shadow:inset 0 4px 4px -3px #070e13,inset 0 -4px 4px -3px #070e13, + inset 4px 0 5px -4px #081116,inset -4px 0 5px -4px #081116; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter{ + border:0;border-radius:2px;background:#080f14; + box-shadow:inset 0 1px 2px #0009,inset 1px 0 2px #000c,inset -1px 0 2px #000b; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter::after{ + inset:0;background:linear-gradient(180deg,#d3eced10,transparent 35%); +} +/* LUFS / dBTP: exactly two lines in a black glass LCD. No blur/compositor. */ +#app #masterLeft .master-controls-zone .master-analysis{ + box-sizing:border-box;height:38px;min-height:38px;flex:0 0 38px; + display:flex;flex-direction:column;justify-content:center;gap:1px; + margin:0;padding:3px 6px;border:0;border-radius:4px; + background:linear-gradient(180deg,#0d1c1c,#030a0b 35%,#071313); + box-shadow:inset 0 3px 4px -2px #000,inset 2px 0 3px -2px #000, + inset -2px 0 3px -2px #000,inset 0 -1px 0 #40625c77; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row{ + display:flex;align-items:center;justify-content:space-between; + flex:0 0 14px;height:14px;min-height:14px;margin:0; + color:#70c2a1;font:600 9px/14px Consolas,monospace; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong{ + color:#58f3a0;font:700 12px/14px Consolas,monospace; + min-width:0;text-align:right;text-shadow:none; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong.over-limit{ + color:#ff555f;text-shadow:none; +} + +/* Borderless deep LED slit keeps the approved 10px illuminated cell width. */ +#app #mixer .fader-zone .meter-signal-area .meter-fill, +#app #mixer .fader-zone .meter-signal-area .meter-peak{ + left:2px;right:2px; +} diff --git a/web/styles.css b/web/styles.css index f175347e2..f969bac31 100644 --- a/web/styles.css +++ b/web/styles.css @@ -1295,3 +1295,51 @@ html:not([data-mixperf="baseline"]):not([data-mixperf="layers-off"]):not([data-m #app #scenesList .scene-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0} #app #scenesList .scene-delete{flex:0 0 20px;height:18px;padding:0;border:1px solid #53646d;border-radius:2px;background:#26343c;color:#d0dbdf;font-size:14px;line-height:14px} #app #scenesList .scene-delete:hover{background:#40515a} + +/* The mono meter has ONE LED slot, stereo/master TWO. Keep 7px fixed LEDs. */ +#app #mixer .fader-zone .vu-bank.is-mono{ + flex-basis:35px;width:35px;min-width:35px;max-width:35px; +} +#app #mixer .fader-zone .vu-bank.is-mono .vu-bars{ + flex-basis:14px;width:14px;min-width:14px;max-width:14px; +} +/* Same machined recessed folds as fader; no external rectangular stroke. */ +#app #mixer .fader-zone .vu-bank .vu-bars{ + position:relative;isolation:isolate;border:0;border-radius:5px;background:#24343c; + box-shadow:inset 0 4px 4px -3px #070e13,inset 0 -4px 4px -3px #070e13, + inset 4px 0 5px -4px #081116,inset -4px 0 5px -4px #081116; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter{ + border:0;border-radius:2px;background:#080f14; + box-shadow:inset 0 1px 2px #0009,inset 1px 0 2px #000c,inset -1px 0 2px #000b; +} +#app #mixer .fader-zone .vu-bank .meter-unit .meter::after{ + inset:0;background:linear-gradient(180deg,#d3eced10,transparent 35%); +} +/* LUFS / dBTP: exactly two lines in a black glass LCD. No blur/compositor. */ +#app #masterLeft .master-controls-zone .master-analysis{ + box-sizing:border-box;height:38px;min-height:38px;flex:0 0 38px; + display:flex;flex-direction:column;justify-content:center;gap:1px; + margin:0;padding:3px 6px;border:0;border-radius:4px; + background:linear-gradient(180deg,#0d1c1c,#030a0b 35%,#071313); + box-shadow:inset 0 3px 4px -2px #000,inset 2px 0 3px -2px #000, + inset -2px 0 3px -2px #000,inset 0 -1px 0 #40625c77; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row{ + display:flex;align-items:center;justify-content:space-between; + flex:0 0 14px;height:14px;min-height:14px;margin:0; + color:#70c2a1;font:600 9px/14px Consolas,monospace; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong{ + color:#58f3a0;font:700 12px/14px Consolas,monospace; + min-width:0;text-align:right;text-shadow:none; +} +#app #masterLeft .master-controls-zone .master-analysis .master-info-row strong.over-limit{ + color:#ff555f;text-shadow:none; +} + +/* Borderless deep LED slit keeps the approved 10px illuminated cell width. */ +#app #mixer .fader-zone .meter-signal-area .meter-fill, +#app #mixer .fader-zone .meter-signal-area .meter-peak{ + left:2px;right:2px; +}