diff --git a/docs/HARMONICE_PHYSICAL_KEYS_SOF_CONTRACT.md b/docs/HARMONICE_PHYSICAL_KEYS_SOF_CONTRACT.md index efc83f06a..c80aebdd0 100644 --- a/docs/HARMONICE_PHYSICAL_KEYS_SOF_CONTRACT.md +++ b/docs/HARMONICE_PHYSICAL_KEYS_SOF_CONTRACT.md @@ -1,64 +1,57 @@ -# Harmonice v9 physical MUTE / SOLO / PFL — SOF integration contract +# Approved v9 MUTE / SOLO / PFL hardware keys — MAIN MIX and SOF -## Artwork provenance and nonnegotiable look +**Owner correction — 13 November 2026.** This contract supersedes the +previous PR #610 rule that put PRE/POST in the Main Mix third-key position. +That caused the user-visible regression: PFL appeared only in SOF. The +operator-approved v9 physical key row is MUTE / SOLO / PFL in the normal +mixer **and** in Sends on Faders. -Use the user's approved **Harmonice_Thin_Flat_Bezel_v9_PFL_FontMatched_Assets.zip**. -The blue PFL PNG master has the same thin flat bezel, cap geometry, typography -and ON text debossing as the v9 MUTE/SOLO faces. Do not recreate it in CSS/SVG. +## Approved PNG, unchanged -- Existing production 4×3, 57×30-per-cell MUTE/SOLO/PRE/POST atlas remains - **exactly unchanged**: - `site/preview-buttons/assets/harmonice-thin-flat-v9-approved-off-shadow-57x30.png`. -- New approved **PFL OFF / PFL ON** raster is a separate 2×1 114×30 RGBA atlas: - `site/preview-buttons/assets/harmonice-thin-flat-v9-pfl-font-matched-57x30.png`. +- Original MUTE/SOLO/PRE/POST 228 x 90 approved asset remains byte-identical: + `site/preview-buttons/assets/harmonice-thin-flat-v9-approved-off-shadow-57x30.png` +- Approved 114 x 30 PFL OFF/ON FontMatched RGBA sprite remains byte-identical: + `site/preview-buttons/assets/harmonice-thin-flat-v9-pfl-font-matched-57x30.png` - PFL sprite SHA256: `1ede18534fa678461ebcb1a100a61170700d75048b11607600cf09d9de8872fd`. -- Display through the same `mixer-control-keys.css` and existing - `strip(t)` renderer; the artwork remains PNG, never a CSS imitation. -- PFL OFF inherits the two approved v9 lower-alpha drop shadows; PFL ON does - **not** inherit OFF shadow. Neither frame alters button hitbox/strip height. +- The sole physical key owner is `mixer-control-keys.css`; no CSS substitute + for PNG, new glow, new button geometry, independent renderer, or extra skin. -## One workspace decides the third physical key +## Physical key row -| Context | Source audio strip | BUS/FX strip | MASTER | +| Workspace | Audio | BUS / FX | MASTER | | --- | --- | --- | --- | -| MAIN MIX | MUTE, SOLO, PRE/POST | MUTE, SOLO, PRE/POST | MUTE, SOLO | -| SOF | **MUTE, SOLO, PFL** | MUTE, SOLO | MUTE, SOLO | - -PFL is **not** a replacement for PRE/POST routing. In SOF, the selected -send's PRE/POST belongs in the contextual **FX/send processing panel** (PR -#604); its hardware key row uses PFL. The PFL key does not change the -SOF target's send tap/gain or the channel's PRIMARY MAIN edge. - -## Monitoring and state contract - -- Browser reference: PFL uses the existing per-channel `cue` state, purely - as visual feedback. The browser generates no real monitored audio and - **must not feed cue into MAIN**. PFL is initially OFF. -- Leaving SOF clears browser-only PFL requests; there must be no invisible - armed cue. Normal MUTE/SOLO survive workspace changes. -- Native: PFL is disabled / visibly OFF until a separate pre-fader MONITOR - L/R bus has a real native route and ACK/readback. The existing native - bridge `consumeAction('cue')` fails closed; the button must never simulate - monitor audio or claim native availability. -- Native SOF itself remains unavailable until native send gain/tap support is - admitted. This PR does **not** implement an audio PCM audition bus. - -## Concurrent work: draft PR #604 - -**Do not overwrite or independently merge #604's experimental SOF branch.** -The SOF author must forward-port the third-key decision from `strip(t)`: -`sofPfl = sofEnabled && t.kind==='audio'`, `hasTap = t.kind!=='master' && -!sofEnabled`. When SOF is active, preserve PFL in the MUTE/SOLO key row -and keep per-EdgeId PRE/POST in the contextual SOF panel. Preserve the one -existing key CSS owner, both approved raster sprites and native fail-closed -behavior. Do not restore PFL into MAIN MIX or the hidden Clear PFL toolbar. - -## Regression evidence - -- Fast `tests/harmonice_v7_keys_contract.py` checks SHA, dimensions, the - existing MUTE/SOLO sprite, renderer contracts and native guard. -- Existing Chromium Stage D checks both contexts, PFL OFF→ON without layout - changes, actual sprite URL/frame/shadow, no MASTER PFL, and reset on exiting - SOF. It does not assert any native PCM audio. -- Publish only the single `/preview/` GUI; `/preview-prod/` is a frozen - pre-v7 comparison and must remain unchanged. +| Main Mix (default) | MUTE / SOLO / **PFL** | MUTE / SOLO / **PFL** | MUTE / SOLO | +| Sends on Faders | MUTE / SOLO / **PFL** | MUTE / SOLO / **PFL** | MUTE / SOLO | + +PFL is not a PRE/POST send tap. The Main Mix no longer installs a global +channel `tapMode` button that can unintentionally retarget *all* parallel +send edges. Send PRE/POST is a **per-EdgeId** routing control in the existing +WIRE Route Inspector; in the contextual SOF implementation (#604 included by +advanced #606), it belongs in the selected target's SEND CONTROLS section. +That experimental branch needs this v9 main-key change forward-ported +before integration; do not merge it over the approved current main. + +The existing WIRE connection mode selector and per-edge tap controls remain. +Neither PFL nor switching workspaces may create, remove, or retarget WIRE. + +## Truthful audio status + +- Browser-only `cue` is a visual selection, **not audio**. Clicking PFL can + illuminate the exact approved blue PNG, but it does not alter MAIN, + send topology, faders, MUTE/SOLO, or monitoring sound. +- PFL is visible in both workspaces and its browser selection must survive + Main Mix <-> SOF changes; there is no hidden stale cue request. +- Native JUCE/WebView2: PFL must be visibly OFF/disabled until a genuinely + admitted independent pre-fader MONITOR L/R path has an engine ACK/readback. + Native bridge `consumeAction('cue')` already fails closed. +- This change is a GUI correction only, not a claim of native PFL audio, + Windows/ASIO FAT, or complete native SOF. + +## Tests and publishing + +The source/raster contract, the Stage D Chromium browser smoke, public +Pages PNG/WIRE browser smoke, and archive contract must check third-key PFL +in **default Main Mix before any SOF click**, then after SOF toggle, and the +MASTER-only two-key row. Original approved PNG hashes, PFL OFF shadows, +blue PFL ON, ON/OFF hitboxes, and WIRE per-edge controls are protected. +Publish only the assembled `/preview/`; historical `/preview-prod/` remains frozen. diff --git a/site/preview-buttons/README.md b/site/preview-buttons/README.md index 64adb0708..e3f2d2e0f 100644 --- a/site/preview-buttons/README.md +++ b/site/preview-buttons/README.md @@ -1,7 +1,8 @@ # Approved PNG hardware keys — internal build dependency -This directory owns **only** the approved MUTE/SOLO/PRE/POST assets: +This directory owns the approved MUTE/SOLO/PRE/POST historical atlas and PFL FontMatched extension: - `assets/harmonice-thin-flat-v9-approved-off-shadow-57x30.png` +- `assets/harmonice-thin-flat-v9-pfl-font-matched-57x30.png` - `assets/mixer-control-keys.css` - `assets/mixer-control-keys.js` @@ -22,3 +23,19 @@ No outgoing parallel SEND: POST is rendered as a **non-illuminated graphite PNG* ## Harmonice v9 refined — approved physical OFF-only shadow The authoritative raster is `assets/harmonice-thin-flat-v9-approved-off-shadow-57x30.png`, a 228×90 RGBA atlas built pixel-for-pixel from the **57×30 1× images embedded in** the user-approved `Harmonice_Thin_Flat_Bezel_v9_Refined_OFF_Shadow_Interactive_AB.html`. Frame mapping (4 columns × 3 rows) is unchanged from v8. The stylesheet adds only the exact two transparent alpha `drop-shadow` layers from the approved A/B HTML to OFF faces: MUTE OFF, SOLO OFF, PRE OFF. ON faces, POST idle/active and MIX get no added shadow. Outer bezel, cap, wording, scaling, alpha, glyphs, and device/routing behavior stay untouched. The shadow is painted on the raster `::before` alpha, not the clickable hitbox; PFL remains hidden and `/preview-prod/` remains the old historical archive. + +## Current owner correction — 13 November 2026 + +The historical v7/v8/v9 PRE/POST row and hidden-PFL description above +documents **earlier designs**, not the current product behavior. PR #610 +mistakenly limited approved PFL to SOF, leaving PRE/POST as the Main Mix third +button. This is superseded. + +**Main Mix and SOF now display approved v9 MUTE / SOLO / PFL** on every +non-MASTER channel. MASTER retains MUTE/SOLO. The channel-global tap button +is removed; send PRE/POST remains available per EdgeId in the WIRE Route +Inspector, and belongs in the contextual SOF SEND CONTROLS under work in +#604/#606. PFL is still reference-only in a browser and disabled on native +until MONITOR L/R routing is truly admitted. PFL selection persists when +switching between Main Mix and SOF. The PNG originals are unchanged. +See `docs/HARMONICE_PHYSICAL_KEYS_SOF_CONTRACT.md`. diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index a44442f5c..1fc7f9650 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -698,38 +698,17 @@ code+=sectionFx(t)+sectionSend(t); code+='
PAN'+panLabel(t.pan)+'
'; - // PRE/POST describes the source channel's outgoing parallel WIRE sends - // only. A direct MAIN wire is not a PRE/POST send and cannot light this key. - const parallelSends=wireEdges.filter(e=>e.enabled&&e.sourceId===t.id&&e.kind==='send'&&e.destId!==master.id); - const allSendPost=parallelSends.length>0&¶llelSends.every(e=>e.mode==='send'); - const allSendPre=parallelSends.length>0&¶llelSends.every(e=>e.mode==='split'); - const tapMode=allSendPost?'send':allSendPre?'split':parallelSends.length?'mixed':t.wireTapMode==='split'?'split':'send'; - const nativeTapUnavailable=!!window.__JUCE__?.backend; - // An unpatched channel has a future WIRE default, not an illuminated send. - // Four dedicated PNG frames avoid CSS-faked lighting: PRE, POST idle, POST - // routed, MIX (several outgoing SEND edges with different tap positions). - const tapVisual=nativeTapUnavailable?'idle': - parallelSends.length===0?(tapMode==='split'?'pre':'idle'): - tapMode==='mixed'?'mixed':tapMode==='split'?'pre':'post'; - const tapText=tapVisual==='mixed'?'MIX':tapVisual==='pre'?'PRE':'POST'; - const tapTitle=nativeTapUnavailable?'PRE/POST unavailable until native WIRE tap ACK; routing unchanged': - !parallelSends.length?'No parallel sends · '+(tapMode==='split'?'PRE':'POST')+ - ' is only the future WIRE default; primary MAIN unchanged': - tapMode==='mixed'?'Mixed PRE and POST parallel WIRE sends · click to set all POST': - (tapMode==='send'?'POST follows channel fader':'PRE independent before FX')+ - ' · '+parallelSends.length+' outgoing parallel SEND(s), primary MAIN unchanged'; - // Shared v9 physical keys: MUTE/SOLO in both contexts, PFL only in SOF - // audio channels. PRE/POST remains the normal MAIN MIX routing control. - const sofPfl=sofEnabled&&t.kind==='audio'; - const hasTap=t.kind!=='master'&&!sofEnabled; + // Approved v9 physical row: MUTE / SOLO / PFL on every non-MASTER strip + // in MAIN MIX and SOF. Send tap belongs to the selected WIRE EdgeId + // inspector (and the contextual SOF send panel), never this key row. + const showPfl=t.kind!=='master'; const isNative=!!window.__JUCE__?.backend; const pflTitle=isNative?'PFL unavailable · independent native MONITOR L/R not admitted': 'PFL · visual audition request only; no monitoring audio in browser preview'; - code+='
' + code+='
' +'' +''; - if(hasTap)code+=''; - if(sofPfl)code+=''; + if(showPfl)code+=''; code+='
'; code+=sectionFader(t); code+='
'+(sofEnabled&&t.kind==='audio'?'S ': '')+formatDb(sofEnabled&&t.kind==='audio'?getSofLevel(t):t.level)+'
'; @@ -838,8 +817,8 @@ function toggleSof(force){ sofEnabled=typeof force==='boolean'?force:!sofEnabled; if(sofEnabled&&!sofTarget){sofEnabled=false;say('Create a Bus or FX Return to use Sends on Faders');return;} - // Don't leave a hidden browser-only PFL request armed outside SOF. - if(!sofEnabled){tracks.forEach(channel=>{channel.cue=false;});master.cue=false;} + // PFL is visible in both workspaces; changing fader context must not + // silently clear the channel's browser-only cue selection. const btn=document.getElementById('sofToggle');btn.classList.toggle('active',sofEnabled); btn.setAttribute('aria-pressed',String(sofEnabled));document.querySelector('.console-body').classList.toggle('sends-mode',sofEnabled); render();say(sofEnabled?'SENDS ON FADERS: adjusting '+sofTarget+' send levels · main faders protected':'MAIN MIX: faders control primary channel level'); @@ -2042,36 +2021,14 @@ if(a==='openPlugin'){openFastPicker(t,Number(btn.dataset.slot),btn);return;} if(a==='removeFx'){if(deferNativeFxIntent('Remove FX insert'))return;const i=Number(btn.dataset.slot);t.fx[i]='None';t.slotBypass[i]=false;if(t.fxInsertIds)t.fxInsertIds[i]=null;fxReorderUndo=null;refreshStrip(t);say(t.name+' · cleared FX insert '+(i+1));return;} if(a==='slotPower'){if(deferNativeFxIntent('FX insert bypass'))return;const slot=Number(btn.dataset.slot);if(t.fx[slot]==='None'){say(t.name+': choose an effect before toggling bypass');return;}t.slotBypass[slot]=!t.slotBypass[slot];refreshStrip(t);say(t.name+': FX '+(slot+1)+(t.slotBypass[slot]?' bypassed':' enabled'));return;} - if(a==='tapMode'){ - if(t.kind==='master')return; - // PRE/POST is a structural native DSP tap change, NOT a cosmetic button. - // The current native bridge rejects MODE without verified PCM ACK. Never - // alter the local presentation in native mode until that capability exists. - if(window.__JUCE__?.backend){ - say('PRE/POST is unavailable for this native graph · routing unchanged'); - return; - } - const sends=wireEdges.filter(edge=>edge.enabled&&edge.sourceId===t.id&&edge.kind==='send'&&edge.destId!==master.id); - // Mixed taps resolve predictably to POST on first click; next click selects PRE. - const allPost=sends.length>0&&sends.every(edge=>edge.mode==='send'); - const next=sends.length?(allPost?'split':'send'):(t.wireTapMode==='split'?'send':'split'); - if(sends.length&&!wireGraphCommit(sends.map(edge=>({type:'MODE',sourceId:t.id,edgeId:edge.id,mode:next}))))return; - t.wireTapMode=next; - if(wireSourceId===t.id){wireMode=next;document.getElementById('wireMode').value=next;} - refreshStrip(t);selectTrack(t); - say(t.name+' '+(next==='split'?'PRE (independent pre-FX)':'POST (follow fader)')+ - ' · outgoing parallel WIRE sends '+(sends.length?'updated':'default selected')+ - ' · primary MAIN unchanged · GUI reference only'); - return; - } if(a==='eq')t.eq=!t.eq; else if(a==='fxOn'){if(deferNativeFxIntent('FX chain bypass'))return;t.fxOn=!t.fxOn;} else if(a==='pre'){t.pre=!t.pre;syncActiveSend(t);} else if(a==='sendOn'){say('Legacy SEND disabled; patch via WIRE');return;} else if(a==='cue'){ // Only a browser-reference cue selection; never route to MAIN/audio. - if(!sofEnabled||t.kind!=='audio'||window.__JUCE__?.backend){ - say('PFL requires SOF and an admitted independent native monitor'); + if(t.kind==='master'||window.__JUCE__?.backend){ + say('PFL requires an admitted independent native monitor'); return; } t.cue=!t.cue; diff --git a/tests/approved_css_stage_d_single_bundle_smoke.py b/tests/approved_css_stage_d_single_bundle_smoke.py index 00c7eacf2..b8213adfb 100644 --- a/tests/approved_css_stage_d_single_bundle_smoke.py +++ b/tests/approved_css_stage_d_single_bundle_smoke.py @@ -48,53 +48,44 @@ async def main(): if stats["cssRules"] is not None: assert stats["cssRules"] > 100, (size,stats) assert stats["keys"] >= 3 and "harmonice-thin-flat-v9-approved-off-shadow-57x30.png" in stats["image"], (size,stats) - assert stats["kinds"] == ["mute","solo","tap"], (size,stats) - tap=page.locator("#tracks .strip[data-id='1'] [data-hw-kind='tap']") - assert await tap.get_attribute("data-tap-visual")=="idle", "No-send POST must be unlit" - # Visual parity with the approved v9 HTML at physical 1x: - # only raised OFF PNG faces receive lower alpha drop-shadow. - off_filters=await page.evaluate("""() => { - const f=(selector)=>getComputedStyle( - document.querySelector(selector),"::before").filter; - const row="#tracks .strip[data-id='1'] .mx-hw-row "; - return { - mute:f(row+'[data-hw-kind="mute"]'), - solo:f(row+'[data-hw-kind="solo"]'), - idle:f(row+'[data-hw-kind="tap"]') - }; - }""") - assert "drop-shadow(" in off_filters["mute"],off_filters - assert "drop-shadow(" in off_filters["solo"],off_filters - assert off_filters["idle"]=="none",off_filters - await tap.click() - assert await tap.get_attribute("data-tap-visual")=="pre" - pre_filter=await tap.evaluate("(e)=>getComputedStyle(e,'::before').filter") - assert "drop-shadow(" in pre_filter,pre_filter - await tap.click() # restore neutral no-SEND POST for WIRE tests - assert await tap.get_attribute("data-tap-visual")=="idle" + assert stats["kinds"] == ["mute","solo","pfl"], (size,stats) + row=page.locator("#tracks .strip[data-id='1'] .mx-hw-row") + pfl=row.locator('[data-hw-kind="pfl"]') + assert await row.locator('[data-hw-kind="tap"]').count()==0 assert await page.locator("#master .mx-hw-row .mx-hw-key").count()==2 - assert await page.locator("#clearCue").is_hidden(), "PFL toolbar must stay hidden" + assert await page.locator("#clearCue").is_hidden() + artwork=await pfl.evaluate("""e=>({ + bg:getComputedStyle(e,'::before').backgroundImage, + position:getComputedStyle(e,'::before').backgroundPosition, + shadow:getComputedStyle(e,'::before').filter + })""") + assert "harmonice-thin-flat-v9-pfl-font-matched-57x30.png" in artwork["bg"] + assert artwork["position"].startswith("0%"), artwork + assert "drop-shadow(" in artwork["shadow"], artwork + await pfl.click() + assert await pfl.get_attribute("aria-pressed")=="true" + on_art=await pfl.evaluate("""e=>({ + position:getComputedStyle(e,'::before').backgroundPosition, + shadow:getComputedStyle(e,'::before').filter + })""") + assert on_art["position"].startswith("100%") and on_art["shadow"]=="none" + await pfl.click() + assert await pfl.get_attribute("aria-pressed")=="false" if size[0]==1680: - # UI-only regression: no private closure APIs or test - # injection. A real source OUT and destination IN must - # determine the physical POST/MIX artwork. + # WIRE remains usable, but cannot replace third key or + # mass-retarget sends via a channel-global tap button. body=page.locator(".console-body") if "collapsed-send" in (await body.get_attribute("class") or ""): await page.locator('.section-rail [data-section="send"]').click() await page.locator('#tracks .strip[data-id="1"] .wire-node-out').click() await page.locator('#tracks .strip[data-id="3"] .wire-node-in').click() - tap=page.locator("#tracks .strip[data-id='1'] [data-hw-kind='tap']") - assert await tap.get_attribute("data-tap-visual")=="post", "Real POST send must illuminate" + assert await row.locator('[data-hw-kind="pfl"]').count()==1 await page.locator("#wireConfigToggle").click() await page.locator("#wireMode").select_option("split") await page.locator("#wireConfigClose").click() await page.locator('#tracks .strip[data-id="1"] .wire-node-out').click() await page.locator('#tracks .strip[data-id="4"] .wire-node-in').click() - tap=page.locator("#tracks .strip[data-id='1'] [data-hw-kind='tap']") - assert await tap.get_attribute("data-tap-visual")=="mixed", "Mixed sends must have honest MIX artwork" - assert await tap.get_attribute("aria-pressed")=="mixed" - await tap.click() - assert await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='tap']").get_attribute("data-tap-visual")=="post", "MIX click must retarget sends to POST" + assert await row.locator('[data-hw-kind="tap"]').count()==0 assert "arsonmix-approved-runtime.css?sha=" in stats["links"][0] assert len(css_requests) == 1, (size,css_requests) assert not errors, errors @@ -134,11 +125,13 @@ async def main(): })""") assert on_pfl["position"].startswith("100%"),on_pfl assert on_pfl["shadow"]=="none",on_pfl - # Hidden PFL requests cannot survive leaving SOF. + # PFL stays visible and its selection survives switching + # between MAIN MIX and SOF, never mutating WIRE. await page.locator("#sofToggle").click() - assert await page.locator("#tracks [data-hw-kind='pfl']").count()==0 - assert await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='tap']").count()==1 + assert await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='pfl']").get_attribute("aria-pressed")=="true" await page.locator("#sofToggle").click() + assert await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='pfl']").get_attribute("aria-pressed")=="true" + await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='pfl']").click() assert await page.locator("#tracks .strip[data-id='1'] [data-hw-kind='pfl']").get_attribute("aria-pressed")=="false" await page.locator("#sofToggle").click() assert len(css_requests) == 1, (size,css_requests) @@ -147,7 +140,7 @@ async def main(): size,"CSS rules",stats["cssRules"]) finally: await browser.close() - print("PASS one approved runtime CSS, Harmonice v9 PNG MUTE/SOLO/PRE-POST, zero late CSS link") + print("PASS one approved runtime CSS, Harmonice v9 PNG MUTE/SOLO/PFL, zero late CSS link") if __name__ == "__main__": asyncio.run(main()) diff --git a/tests/harmonice_v7_keys_contract.py b/tests/harmonice_v7_keys_contract.py index 4de4ce4f9..414ca1aee 100644 --- a/tests/harmonice_v7_keys_contract.py +++ b/tests/harmonice_v7_keys_contract.py @@ -1,7 +1,7 @@ -"""Harmonice v9 approved PNG button integration — fast source/asset guard. +"""Approved v9 channel keys: MUTE / SOLO / PFL in MAIN MIX and SOF. -Tests one owner, physical PNG, PFL only in SOF (not main), atomic reference tap -transactions and native fail-closed behavior. This is NOT hardware PCM proof. +Checks user-signed PNG bytes and source/native safety contracts. Does not claim +native PFL monitoring, DSP admission, or Windows hardware FAT. """ from pathlib import Path import hashlib @@ -14,76 +14,57 @@ CSS = (OWNER / "mixer-control-keys.css").read_text(encoding="utf-8") BUILD = (ROOT / "scripts/build_pages.py").read_text(encoding="utf-8") BRIDGE = (ROOT / "web/approved-native-bridge.js").read_text(encoding="utf-8") -ASSET = "harmonice-thin-flat-v9-approved-off-shadow-57x30.png" +OLD = "harmonice-thin-flat-v9-approved-off-shadow-57x30.png" +PFL = "harmonice-thin-flat-v9-pfl-font-matched-57x30.png" -class HarmoniceV7KeysTests(unittest.TestCase): - def test_one_png_owner_with_alpha_and_correct_frames(self): - png = (OWNER / ASSET).read_bytes() - self.assertEqual(png[:8], b"\x89PNG\r\n\x1a\n") - self.assertEqual(struct.unpack(">II", png[16:24]), (228, 90)) - self.assertEqual(hashlib.sha256(png).hexdigest(), "3a7b179fd9cc028f988215ea7f3b9e4a73a68031a7051d6e670df01aea940a6a", "PNG must match approved v9 raster, byte for byte") - self.assertIn(png[25], (3, 6)) - if png[25] == 3: - self.assertIn(b"tRNS", png) - self.assertIn('background-image:url("' + ASSET + '")', CSS) - self.assertIn("aspect-ratio:57/30", CSS) +class HarmoniceV9KeysTests(unittest.TestCase): + def test_exact_approved_artwork(self): + original = (OWNER / OLD).read_bytes() + pfl = (OWNER / PFL).read_bytes() + self.assertEqual(original[:8], bytes.fromhex("89504e470d0a1a0a")) + self.assertEqual(struct.unpack(">II", original[16:24]), (228, 90)) + self.assertEqual(hashlib.sha256(original).hexdigest(), + "3a7b179fd9cc028f988215ea7f3b9e4a73a68031a7051d6e670df01aea940a6a") + self.assertEqual(struct.unpack(">II", pfl[16:24]), (114, 30)) + self.assertEqual(pfl[25], 6) + self.assertEqual(hashlib.sha256(pfl).hexdigest(), + "1ede18534fa678461ebcb1a100a61170700d75048b11607600cf09d9de8872fd") + self.assertIn('background-image:url("' + OLD + '")', CSS) + self.assertIn('background-image:url("' + PFL + '")', CSS) self.assertIn("background-size:400% 300%", CSS) - self.assertIn('drop-shadow(0 .8px 1.15px rgba(0,0,0,.42))', CSS) - self.assertIn('drop-shadow(0 1.7px 2.1px rgba(0,0,0,.32))', CSS) - self.assertIn('[data-hw-kind="tap"][data-tap-visual="pre"]::before', CSS) - self.assertIn('[data-hw-kind="mute"][aria-pressed="false"]::before', CSS) - self.assertIn('[data-hw-kind="solo"][aria-pressed="false"]::before', CSS) - for kind, pos in (("tap", "0%"), ("mute", "50%"), ("solo", "100%")): - self.assertIn('data-hw-kind="' + kind + '"]{--mx-native-y:' + pos + '}', CSS) - self.assertIn("sprite='" + ASSET + "'", BUILD) - - def test_three_visible_keys_and_cue_state_kept_hidden(self): - for action in ("mute", "solo", "tapMode"): - self.assertIn('data-action="' + action + '"', HTML) - self.assertNotIn('data-hw-kind="cue"', HTML) - self.assertIn('id="clearCue" hidden disabled', HTML) - self.assertIn('style="display:none"', HTML)\n self.assertNotIn('