From b5698eb2a1b5494dc59ee6998caec007a8a42cc0 Mon Sep 17 00:00:00 2001 From: Dogfather Date: Thu, 5 Nov 2026 15:26:19 +0100 Subject: [PATCH] =?UTF-8?q?Runde=207:=20Stream-Deck-Tasten=20zeigen=20Zeic?= =?UTF-8?q?hen=20und=20Zustand,=20MIDI-Pads=20bekommen=20Note=20an/aus,=20?= =?UTF-8?q?Saal-Fenster=20=C3=B6ffnet=20mit=20Zocken=20starten=20(mit=20Sp?= =?UTF-8?q?ende,=20Tipp-Runde,=20Zuschauerzahl);=20mess-zocken=20mit=20eig?= =?UTF-8?q?enem=20Handy-Zugang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- server/mess-zocken.mjs | 12 +- server/pruef-streamdeck-blick.mjs | 26 ++++- server/pruef-ton-quellen-blick.mjs | 6 + workspace/anleitung.html | 28 ++--- workspace/anruf-probe.html | 10 +- workspace/app.webmanifest | 8 +- workspace/assets/css/saalfenster.css | 7 ++ workspace/assets/js/pads.js | 74 +++++++++++- workspace/assets/js/saalfenster.js | 47 +++++++- workspace/aufgaben.html | 38 +++--- workspace/automation.html | 32 +++--- workspace/befinden.html | 34 +++--- workspace/bereich.html | 48 ++++---- workspace/bewerben.html | 38 +++--- workspace/bewerbungen.html | 36 +++--- workspace/buehne.html | 12 +- workspace/calls.html | 34 +++--- workspace/chat.html | 48 ++++---- workspace/content.html | 34 +++--- workspace/crew-index.html | 12 +- workspace/crew.webmanifest | 8 +- workspace/dateien.html | 34 +++--- workspace/dogtags.html | 38 +++--- workspace/entwicklung.html | 36 +++--- workspace/fernbedienung.html | 20 ++-- workspace/hilfe.html | 30 ++--- workspace/index.html | 10 +- workspace/kalender.html | 34 +++--- workspace/koppeln.html | 14 +-- workspace/leistung.html | 32 +++--- workspace/manager-ziele.html | 30 ++--- workspace/material.html | 32 +++--- workspace/nachbericht.html | 22 ++-- workspace/notizen.html | 28 ++--- workspace/personen.html | 32 +++--- workspace/probesaal.html | 14 +-- workspace/profil.html | 36 +++--- workspace/reaktion-foyer.html | 36 +++--- workspace/reaktion.html | 166 +++++++++++++-------------- workspace/rechte.html | 34 +++--- workspace/report.html | 36 +++--- workspace/scouting.html | 32 +++--- workspace/start.html | 40 +++---- workspace/startcheck.html | 34 +++--- workspace/steckbrief.html | 36 +++--- workspace/support.html | 32 +++--- workspace/tafel.html | 10 +- workspace/talente.html | 36 +++--- workspace/team.html | 32 +++--- workspace/teamlage.html | 34 +++--- workspace/teilen.html | 30 ++--- workspace/treff-moderation.html | 32 +++--- workspace/treff-regeln.html | 32 +++--- workspace/uebersicht.html | 32 +++--- workspace/unsere-seiten.html | 30 ++--- workspace/unterstuetzen.html | 32 +++--- workspace/werdegang.html | 32 +++--- workspace/willkommen.html | 2 +- workspace/wissen.html | 34 +++--- 59 files changed, 1000 insertions(+), 848 deletions(-) diff --git a/server/mess-zocken.mjs b/server/mess-zocken.mjs index 57ede3af..e5cbf5db 100644 --- a/server/mess-zocken.mjs +++ b/server/mess-zocken.mjs @@ -107,9 +107,13 @@ function anlegen(name, rolle, code) { .run(name, rolle, hash, salt, 32768, createHmac("sha256", kenn).update(code).digest("hex"), ALT); } -const CODES = { admin: "CODE-Z00-000001", gast: "CODE-Z01-000001" }; +const CODES = { admin: "CODE-Z00-000001", gast: "CODE-Z01-000001", handy: "CODE-Z02-000001" }; anlegen("Filipe", "admin", CODES.admin); anlegen("Nachtfalter", "gast", CODES.gast); +/* EIN EIGENER ZUGANG FÜR DIE HANDY-ZUSCHAUER (05.11.2026): Mit demselben Zugang + wie der Rechner-Zuschauer nahm jede Handy-Seite dessen Leitung (eine je Person + auf dem Direktweg) – danach maß der Rechner-Zuschauer Stille. */ +anlegen("Lenny", "gast", CODES.handy); d.close(); function roh(pfad, { method = "GET", keks = "", rumpf = null } = {}) { @@ -138,11 +142,11 @@ function roh(pfad, { method = "GET", keks = "", rumpf = null } = {}) { } async function anmelden(rolle) { const a = await roh("/workspace/api/anmelden", { - method: "POST", rumpf: { rolle, code: CODES[rolle], alter_ok: true }, + method: "POST", rumpf: { rolle: rolle === "handy" ? "gast" : rolle, code: CODES[rolle], alter_ok: true }, }); return [].concat(a.kopf["set-cookie"] || []).map((z) => z.split(";")[0]).join("; "); } -const k = { admin: await anmelden("admin"), gast: await anmelden("gast") }; +const k = { admin: await anmelden("admin"), gast: await anmelden("gast"), handy: await anmelden("handy") }; /* ---------- Der Vorbau (https, weil WebRTC es verlangt) ----------------- */ const schluesselDatei = join(ordner, "p.key"); @@ -627,7 +631,7 @@ ok(kam, "beim Zuschauer kommt ein Bild an (videoWidth > 0)"); nur „liegt sie obenauf", sondern auch: ganz im Bild, auf keinem anderen Bedienelement, und keine Schrift unter 11 Punkten. */ for (const [lage, b, h] of [["hoch", 390, 844], ["schmal", 360, 780], ["quer", 844, 390]]) { - const hy = await alsWer("gast", false, b, h); + const hy = await alsWer("handy", false, b, h); await hy.seite.goto(`${BASIS}/workspace/reaktion.html`, { waitUntil: "domcontentloaded" }); const da = await warteBis(() => hy.seite.evaluate(() => !!document.querySelector('.sziel[data-an="ja"] .szk[data-sichtbar="ja"]') diff --git a/server/pruef-streamdeck-blick.mjs b/server/pruef-streamdeck-blick.mjs index f7bded79..f66cabf0 100644 --- a/server/pruef-streamdeck-blick.mjs +++ b/server/pruef-streamdeck-blick.mjs @@ -206,12 +206,14 @@ seite.on("console", (m) => { if (m.type() === "error" && !/compute-pressure|yout Tasten ab Byte 3). */ await seite.addInitScript(() => { const geraet = { vendorId: 0x0fd9, productId: 0x0080, productName: "Stream Deck MK.2", opened: false, h: [], - async open() { this.opened = true; }, addEventListener(a, f) { if (a === "inputreport") this.h.push(f); }, removeEventListener(a, f) { this.h = this.h.filter((x) => x !== f); } }; + async open() { this.opened = true; }, berichte: [], async sendReport(id, daten) { this.berichte.push({ id, d: Array.from(daten.slice(0, 7)), jpeg: daten[7] === 0xff && daten[8] === 0xd8 }); }, addEventListener(a, f) { if (a === "inputreport") this.h.push(f); }, removeEventListener(a, f) { this.h = this.h.filter((x) => x !== f); } }; window.__sd = geraet; window.__sdDruck = (taste) => { const bytes = new Uint8Array(3 + 15); bytes[0] = 0; bytes[1] = 15; if (taste >= 0) bytes[3 + taste] = 1; for (const f of geraet.h) f({ reportId: 1, device: geraet, data: new DataView(bytes.buffer) }); }; + window.__midiAus = []; + navigator.requestMIDIAccess = async () => ({ inputs: new Map(), outputs: new Map([["o1", { name: "RØDECaster", send: (b) => window.__midiAus.push(Array.from(b)) }]]), onstatechange: null }); Object.defineProperty(navigator, "hid", { configurable: true, value: { requestDevice: async () => [geraet], getDevices: async () => [geraet] } }); window.__tasten = []; document.addEventListener("keydown", (e) => { if (!e.isTrusted) window.__tasten.push(e.key); }, true); @@ -255,6 +257,28 @@ const z2 = await seite.evaluate(() => window.Pads.zuordnung()); ok(z2["sd:1:2"] === "band" && !Object.values(z2).includes("moment"), `eine Taste, eine Funktion: Taste 3 ist jetzt nur noch „Band“ (${JSON.stringify(z2)})`); const sagt = await seite.evaluate(() => document.getElementById("pads-sagt").textContent); ok(/Stream Deck · Taste 3 war „Moment merken“/.test(sagt), `und das wird gesagt („${sagt}“)`); +/* Rückmeldung (Runde 7): Taste 3 bekommt ihr Bild (JPEG in 1016er-Stücken, Bericht 2). */ +await warte(1500); +const bilder = await seite.evaluate(() => window.__sd.berichte.filter((b) => b.d[1] === 2)); +ok(bilder.length >= 1 && bilder[0].id === 2 && bilder[0].d[0] === 0x07 && bilder[0].jpeg && bilder.at(-1).d[2] === 1, `Taste 3 bekommt ihr Zeichen als Bild (${bilder.length} Stück, JPEG, letztes markiert)`); +/* Mikro stumm → das Bild der Mikro-Taste wechselt auf „aus“ */ +await seite.evaluate(() => { window.Pads.zuordnen("mikro", "sd:1:7"); window.Pads.zuordnen("kamera", "note:1:36"); }); +await warte(1500); +const vorStumm = await seite.evaluate(() => window.__sd.berichte.filter((b) => b.d[1] === 7).length); +await seite.evaluate(() => { const m = document.getElementById("s-mikro"); m.setAttribute("aria-pressed", "true"); }); +await warte(1500); +const nachStumm = await seite.evaluate(() => window.__sd.berichte.filter((b) => b.d[1] === 7).length); +ok(vorStumm >= 1 && nachStumm > vorStumm, `Mikro stumm: die Mikro-Taste bekommt ein neues Bild (${vorStumm} → ${nachStumm} Berichte)`); +await seite.evaluate(() => document.getElementById("s-mikro").setAttribute("aria-pressed", "false")); +/* MIDI: ein Pad bekommt Note an/aus für seinen Zustand – erst nach dem Verbinden */ +await seite.evaluate(() => window.Pads.verbinden()); +await warte(1500); +const m1 = await seite.evaluate(() => window.__midiAus.slice()); +await seite.evaluate(() => document.getElementById("s-kamera").setAttribute("aria-pressed", "true")); +await warte(1500); +const m2 = await seite.evaluate(() => window.__midiAus.slice()); +await seite.evaluate(() => document.getElementById("s-kamera").setAttribute("aria-pressed", "false")); +ok(m1.some((x) => x[0] === 0x90 && x[1] === 36 && x[2] === 127) && m2.some((x) => x[0] === 0x90 && x[1] === 36 && x[2] === 0), `das Kamera-Pad bekommt Note 36 an (127) und bei „Kamera aus“ aus (0): ${JSON.stringify(m2.slice(-2))}`); if (BILDER) await seite.locator("#pads").screenshot({ path: `${BILDER}/streamdeck-1440.png` }); ok(!konsole.length, `keine Fehler in der Konsole (${konsole.slice(0, 3).join(" | ")})`); await browser.close(); diff --git a/server/pruef-ton-quellen-blick.mjs b/server/pruef-ton-quellen-blick.mjs index ea36f99b..00f46562 100644 --- a/server/pruef-ton-quellen-blick.mjs +++ b/server/pruef-ton-quellen-blick.mjs @@ -209,10 +209,16 @@ await s.goto(`${BASIS}/workspace/reaktion.html`, { waitUntil: "domcontentloaded" await s.waitForSelector("#zock-start", { state: "attached", timeout: 20000 }); await s.waitForFunction(() => window.RegieLaden?.fertig?.(), null, { timeout: 20000 }).catch(() => {}); await s.fill("#zock-titel", "Ton-Probe"); +const pipKommt = kx.waitForEvent("page", { timeout: 15000 }).catch(() => null); await s.click("#zock-start"); let teile = false; for (let i = 0; i < 60 && !teile; i++) { teile = await s.evaluate(() => !!window.SaalKamera?.teile?.()?.spiel); if (!teile) await warte(500); } ok(teile, "beim Zocken gibt es Mikro und Spiel als Einzelausgänge"); +/* Runde 7: Das Saal-Fenster geht mit „Zocken starten“ auf (derselbe Klick, solange die Frist reicht). */ +const pip = await pipKommt; +if (pip) await pip.waitForTimeout(1500); +const pz = pip ? await pip.evaluate(() => ({ stand: document.getElementById("sf-stand")?.textContent, zeilen: [...document.querySelectorAll(".sf-zeile")].map((x) => x.textContent) })) : null; +ok(!!pip && pz?.stand === "LIVE" && pz.zeilen.some((z) => /sehen zu|sieht zu/.test(z)), `„Zocken starten“ öffnet das Saal-Fenster gleich mit, mit Zuschauerzeile (${JSON.stringify(pz)})`); await s.evaluate(() => document.getElementById("reiter-ton")?.click()); let q = null; for (let i = 0; i < 40; i++) { q = await s.evaluate(() => window.Lautheit?.quellen?.()); if (q?.mikro?.bloecke > 30 && q?.spiel?.bloecke > 30) break; await warte(300); } diff --git a/workspace/anleitung.html b/workspace/anleitung.html index 0733e849..401f9128 100644 --- a/workspace/anleitung.html +++ b/workspace/anleitung.html @@ -7,17 +7,17 @@ - - - - - + + + + + - - + + @@ -289,16 +289,16 @@ Und anleitung.js braucht es doppelt: Symbol, Farbe, Name und Adresse jeder Karte kommen von dort, nicht vom Server. --> - + - - - - - - + + + + + + diff --git a/workspace/anruf-probe.html b/workspace/anruf-probe.html index 5161dc01..43562aca 100644 --- a/workspace/anruf-probe.html +++ b/workspace/anruf-probe.html @@ -16,8 +16,8 @@ verdeckt. Gefunden hat es pruef-struktur. Richtig sind `gate.css` (die Farbwerte des Hauses) und `haus.css`. --> - - + + - +