@imperosoft/cris-webui-components 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +179 -1
- package/dist/index.d.ts +179 -1
- package/dist/index.js +687 -237
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +680 -238
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2340,6 +2340,9 @@ function CrisViewComm({ comm, classes, icons, className }) {
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/components/dsp/CrisViewDspFull.tsx
|
|
2342
2342
|
import { useState as useState6 } from "react";
|
|
2343
|
+
import { useCustomObject as useCustomObject7, useCustomObjectSend as useCustomObjectSend7 } from "@imperosoft/cris-webui-ch5-core";
|
|
2344
|
+
|
|
2345
|
+
// src/components/dsp/CrisViewDspInputs.tsx
|
|
2343
2346
|
import { useCustomObject as useCustomObject4, useCustomObjectSend as useCustomObjectSend4 } from "@imperosoft/cris-webui-ch5-core";
|
|
2344
2347
|
|
|
2345
2348
|
// src/components/dsp/DspIoPage.tsx
|
|
@@ -2391,6 +2394,127 @@ function collapseStrips(channels, links) {
|
|
|
2391
2394
|
function linksFor(ln, io) {
|
|
2392
2395
|
return io === "in" ? ln?.ip : ln?.op;
|
|
2393
2396
|
}
|
|
2397
|
+
function groupsFor(dg, io) {
|
|
2398
|
+
return io === "in" ? dg?.ip : dg?.op;
|
|
2399
|
+
}
|
|
2400
|
+
function buildLinkIndex(links) {
|
|
2401
|
+
const idx = /* @__PURE__ */ new Map();
|
|
2402
|
+
for (const raw of links ?? []) {
|
|
2403
|
+
const { label, channels } = normalizeLinked(raw);
|
|
2404
|
+
if (channels.length === 0) continue;
|
|
2405
|
+
const info = { label, channels };
|
|
2406
|
+
for (const id of channels) idx.set(id, info);
|
|
2407
|
+
}
|
|
2408
|
+
return idx;
|
|
2409
|
+
}
|
|
2410
|
+
function collapseWithin(ids, byId, linkIdx, idSet, usedLink, consumed) {
|
|
2411
|
+
const strips = [];
|
|
2412
|
+
for (const id of ids) {
|
|
2413
|
+
if (consumed.has(id)) continue;
|
|
2414
|
+
const link = linkIdx.get(id);
|
|
2415
|
+
const contained = !!link && link.channels.every((m) => idSet.has(m));
|
|
2416
|
+
if (link && contained && !usedLink.has(link)) {
|
|
2417
|
+
usedLink.add(link);
|
|
2418
|
+
link.channels.forEach((m) => consumed.add(m));
|
|
2419
|
+
const primary = link.channels.find((m) => byId.has(m));
|
|
2420
|
+
const ref = primary !== void 0 ? byId.get(primary) : void 0;
|
|
2421
|
+
strips.push({
|
|
2422
|
+
kind: "group",
|
|
2423
|
+
key: `g:${link.channels.join("-")}`,
|
|
2424
|
+
label: link.label || ref?.lb || `Grupo ${link.channels[0]}`,
|
|
2425
|
+
channels: link.channels,
|
|
2426
|
+
lv: clampLevel(ref?.lv),
|
|
2427
|
+
mt: ref?.mt ?? false
|
|
2428
|
+
});
|
|
2429
|
+
} else {
|
|
2430
|
+
consumed.add(id);
|
|
2431
|
+
const c = byId.get(id);
|
|
2432
|
+
if (!c) continue;
|
|
2433
|
+
strips.push({
|
|
2434
|
+
kind: "single",
|
|
2435
|
+
key: `c:${c.id}`,
|
|
2436
|
+
label: c.lb ?? `Canal ${c.id}`,
|
|
2437
|
+
channels: [c.id],
|
|
2438
|
+
lv: clampLevel(c.lv),
|
|
2439
|
+
mt: c.mt
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
return strips;
|
|
2444
|
+
}
|
|
2445
|
+
function buildIoSections(channels, links, groups) {
|
|
2446
|
+
if (!groups || groups.length === 0) {
|
|
2447
|
+
return [{ strips: collapseStrips(channels, links) }];
|
|
2448
|
+
}
|
|
2449
|
+
const byId = new Map(channels.map((c) => [c.id, c]));
|
|
2450
|
+
const linkIdx = buildLinkIndex(links);
|
|
2451
|
+
const usedLink = /* @__PURE__ */ new Set();
|
|
2452
|
+
const consumed = /* @__PURE__ */ new Set();
|
|
2453
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
2454
|
+
const sections = [];
|
|
2455
|
+
for (const g of groups) {
|
|
2456
|
+
g.ch.forEach((id) => assigned.add(id));
|
|
2457
|
+
const present = g.ch.filter((id) => byId.has(id));
|
|
2458
|
+
if (present.length === 0) continue;
|
|
2459
|
+
const strips = collapseWithin(present, byId, linkIdx, new Set(g.ch), usedLink, consumed);
|
|
2460
|
+
if (strips.length) sections.push({ groupName: g.id, strips });
|
|
2461
|
+
}
|
|
2462
|
+
const restIds = channels.filter((c) => !assigned.has(c.id)).map((c) => c.id);
|
|
2463
|
+
if (restIds.length) {
|
|
2464
|
+
const strips = collapseWithin(restIds, byId, linkIdx, new Set(restIds), usedLink, consumed);
|
|
2465
|
+
if (strips.length) sections.push({ strips });
|
|
2466
|
+
}
|
|
2467
|
+
return sections;
|
|
2468
|
+
}
|
|
2469
|
+
function buildMixerAxisGrouped(channels, links, groups) {
|
|
2470
|
+
const byId = new Map(channels.map((c) => [c.id, c]));
|
|
2471
|
+
const ordered = [];
|
|
2472
|
+
const groupOf = /* @__PURE__ */ new Map();
|
|
2473
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
2474
|
+
for (const g of groups ?? []) {
|
|
2475
|
+
for (const id of g.ch) {
|
|
2476
|
+
assigned.add(id);
|
|
2477
|
+
const c = byId.get(id);
|
|
2478
|
+
if (c && !groupOf.has(id)) {
|
|
2479
|
+
ordered.push(c);
|
|
2480
|
+
groupOf.set(id, g.id);
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
for (const c of channels) if (!assigned.has(c.id)) ordered.push(c);
|
|
2485
|
+
const items = ordered.map((c) => ({
|
|
2486
|
+
id: c.id,
|
|
2487
|
+
channelLabel: c.lb ?? `${c.id}`,
|
|
2488
|
+
groupName: groupOf.get(c.id)
|
|
2489
|
+
}));
|
|
2490
|
+
const indexById = new Map(ordered.map((c, idx) => [c.id, idx]));
|
|
2491
|
+
let i = 0;
|
|
2492
|
+
while (i < items.length) {
|
|
2493
|
+
const g = items[i].groupName;
|
|
2494
|
+
if (g === void 0) {
|
|
2495
|
+
i++;
|
|
2496
|
+
continue;
|
|
2497
|
+
}
|
|
2498
|
+
let j = i;
|
|
2499
|
+
while (j < items.length && items[j].groupName === g) j++;
|
|
2500
|
+
items[i].groupStart = true;
|
|
2501
|
+
items[i].groupSpan = j - i;
|
|
2502
|
+
i = j;
|
|
2503
|
+
}
|
|
2504
|
+
for (const raw of links ?? []) {
|
|
2505
|
+
const { label, channels: members } = normalizeLinked(raw);
|
|
2506
|
+
if (members.length < 2) continue;
|
|
2507
|
+
const idxs = members.map((n) => indexById.get(n));
|
|
2508
|
+
if (idxs.some((x) => x === void 0)) continue;
|
|
2509
|
+
const indices = idxs.slice().sort((a, b) => a - b);
|
|
2510
|
+
const consecutive = indices.every((x, k) => k === 0 || x === indices[k - 1] + 1);
|
|
2511
|
+
if (!consecutive) continue;
|
|
2512
|
+
items[indices[0]].linkStart = true;
|
|
2513
|
+
items[indices[0]].linkSpan = indices.length;
|
|
2514
|
+
for (const idx of indices) items[idx].linkCommon = label;
|
|
2515
|
+
}
|
|
2516
|
+
return items;
|
|
2517
|
+
}
|
|
2394
2518
|
function buildMixerAxis(channels, links) {
|
|
2395
2519
|
const items = channels.map((c) => ({
|
|
2396
2520
|
id: c.id,
|
|
@@ -2489,53 +2613,233 @@ function useHorizontalWheel(ref) {
|
|
|
2489
2613
|
}
|
|
2490
2614
|
|
|
2491
2615
|
// src/components/dsp/DspIoPage.tsx
|
|
2492
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2493
|
-
function DspIoPage({
|
|
2616
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2617
|
+
function DspIoPage({
|
|
2618
|
+
status,
|
|
2619
|
+
io,
|
|
2620
|
+
oid,
|
|
2621
|
+
send,
|
|
2622
|
+
show,
|
|
2623
|
+
skip,
|
|
2624
|
+
cls,
|
|
2625
|
+
icons,
|
|
2626
|
+
emptyLabel,
|
|
2627
|
+
bare = false,
|
|
2628
|
+
suppressEmpty = false
|
|
2629
|
+
}) {
|
|
2494
2630
|
const scrollRef = useRef4(null);
|
|
2495
2631
|
useHorizontalWheel(scrollRef);
|
|
2632
|
+
const showSet = show ? new Set(show) : null;
|
|
2496
2633
|
const skipSet = new Set(skip ?? []);
|
|
2634
|
+
const keep = (id) => (!showSet || showSet.has(id)) && !skipSet.has(id);
|
|
2497
2635
|
const raw = (io === "in" ? status?.ip : status?.op) ?? [];
|
|
2498
|
-
const channels =
|
|
2636
|
+
const channels = raw.filter((c) => keep(c.id));
|
|
2499
2637
|
const allLinks = linksFor(status?.ln, io);
|
|
2500
|
-
const links =
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2503
|
-
|
|
2638
|
+
const links = allLinks?.filter((g) => (g.ch ?? []).some((id) => keep(id)));
|
|
2639
|
+
const groups = groupsFor(status?.dg, io)?.filter((g) => (g.ch ?? []).some((id) => keep(id)));
|
|
2640
|
+
const sections = buildIoSections(channels, links, groups);
|
|
2641
|
+
const hasHeaders = sections.some((s) => s.groupName);
|
|
2642
|
+
const totalStrips = sections.reduce((n, s) => n + s.strips.length, 0);
|
|
2643
|
+
if (totalStrips === 0) {
|
|
2644
|
+
return suppressEmpty ? null : /* @__PURE__ */ jsx13("div", { className: cls.message, children: emptyLabel });
|
|
2504
2645
|
}
|
|
2505
|
-
|
|
2646
|
+
const row = /* @__PURE__ */ jsx13(
|
|
2506
2647
|
"div",
|
|
2507
2648
|
{
|
|
2508
|
-
className:
|
|
2649
|
+
className: `flex h-full items-stretch gap-[0.3em] px-[0.5em] py-[0.5em]${bare ? "" : " w-max mx-auto"}`,
|
|
2509
2650
|
style: { minWidth: "min-content" },
|
|
2510
|
-
children:
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2651
|
+
children: sections.map((sec, i) => /* @__PURE__ */ jsxs11("div", { className: "flex flex-col h-full", children: [
|
|
2652
|
+
hasHeaders && // Header band: spans this group's strips. The 1px separator lives only
|
|
2653
|
+
// here (between groups), never down the full channel height.
|
|
2654
|
+
/* @__PURE__ */ jsx13(
|
|
2655
|
+
"div",
|
|
2656
|
+
{
|
|
2657
|
+
className: "flex items-center justify-center shrink-0 h-[2.2em]",
|
|
2658
|
+
style: { borderLeft: i > 0 ? "1px solid rgba(0,0,0,0.4)" : void 0 },
|
|
2659
|
+
children: sec.groupName && /* @__PURE__ */ jsx13("span", { className: cls.groupHeader, title: sec.groupName, children: sec.groupName })
|
|
2660
|
+
}
|
|
2661
|
+
),
|
|
2662
|
+
/* @__PURE__ */ jsx13("div", { className: "flex flex-1 min-h-0 items-stretch gap-[0.3em]", children: sec.strips.map((strip) => /* @__PURE__ */ jsx13(
|
|
2663
|
+
DspChannelStrip,
|
|
2664
|
+
{
|
|
2665
|
+
strip,
|
|
2666
|
+
io,
|
|
2667
|
+
oid,
|
|
2668
|
+
send,
|
|
2669
|
+
cls,
|
|
2670
|
+
icons
|
|
2671
|
+
},
|
|
2672
|
+
strip.key
|
|
2673
|
+
)) })
|
|
2674
|
+
] }, sec.groupName ?? `rest:${i}`))
|
|
2675
|
+
}
|
|
2676
|
+
);
|
|
2677
|
+
if (bare) return row;
|
|
2678
|
+
return /* @__PURE__ */ jsx13("div", { ref: scrollRef, className: "w-full h-full overflow-x-auto no-scrollbar", children: row });
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
// src/components/dsp/dspClasses.ts
|
|
2682
|
+
var DSP_CLASS_DEFAULTS = {
|
|
2683
|
+
root: "w-full h-full flex flex-col",
|
|
2684
|
+
header: "relative w-full flex items-end justify-center gap-[0.3em] px-[1em] pt-[0.5em]",
|
|
2685
|
+
content: "w-full flex-1 min-h-0",
|
|
2686
|
+
tab: "w-[10.5em] h-[3.25em] rounded-b-none rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white text-[1.4em] font-bold",
|
|
2687
|
+
tabActive: "bg-[#007ca0]",
|
|
2688
|
+
message: "w-full h-full flex items-center justify-center text-gray-400 text-[2em]",
|
|
2689
|
+
presetWrap: "absolute left-[1em] bottom-[0.3em] h-[4.5em] flex flex-col items-center",
|
|
2690
|
+
presetLabel: "text-[#4f5152] text-[1.4em] leading-none",
|
|
2691
|
+
preset: "w-[8em] h-full rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white",
|
|
2692
|
+
presetActive: "bg-[#007ca0]",
|
|
2693
|
+
presetPressed: "bg-[#006080]",
|
|
2694
|
+
savedFlash: "absolute inset-0 flex items-center justify-center rounded bg-[#22c55e] text-white text-[1.2em] font-bold pointer-events-none",
|
|
2695
|
+
groupHeader: "text-[#4f5152] text-center font-semibold leading-tight text-[1.1em] line-clamp-2 px-[0.3em]",
|
|
2696
|
+
// NOTE: no font-size on the mixer chrome/group cells — their `em` sticky
|
|
2697
|
+
// offsets must match the grid's `em` track widths. Text size lives on the
|
|
2698
|
+
// inner label spans (text-[1.1em]) instead.
|
|
2699
|
+
mixerGroup: "sticky flex items-center justify-center text-center bg-[#282C34] text-white font-semibold leading-tight border border-black/30",
|
|
2700
|
+
mixerGroupV: "sticky flex items-center justify-center bg-[#282C34] text-white font-semibold leading-tight border border-black/30",
|
|
2701
|
+
strip: "flex flex-col items-center gap-[0.4em] h-full w-[9em] flex-none px-[0.3em]",
|
|
2702
|
+
stripLabel: "text-[#4f5152] text-center leading-tight text-[1.1em] line-clamp-3",
|
|
2703
|
+
levelReadout: "text-[1.1em] text-[#4f5152] leading-none opacity-70 mt-[0.5em]",
|
|
2704
|
+
faderBar: "bg-[#c0c0c0] rounded",
|
|
2705
|
+
faderFill: "bg-[#007ca0] rounded",
|
|
2706
|
+
faderThumb: "bg-[#4f5152] rounded",
|
|
2707
|
+
mute: "w-full h-full rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white",
|
|
2708
|
+
muteActive: "bg-[#dc2626] text-white",
|
|
2709
|
+
mixerBackplate: "bg-[#282C34]",
|
|
2710
|
+
mixerCorner: "sticky z-30 flex items-center justify-center bg-[#282C34] text-[#4f5152] text-[1.1em] font-bold border border-black/30",
|
|
2711
|
+
mixerChrome: "sticky flex items-center justify-center text-center bg-[#282C34] text-white leading-tight border border-black/30",
|
|
2712
|
+
cell: "z-10 flex items-center justify-center border border-black/30",
|
|
2713
|
+
cellOn: "bg-[#22c55e]",
|
|
2714
|
+
cellOff: "bg-[#4f5152]"
|
|
2715
|
+
};
|
|
2716
|
+
var DSP_ICON_DEFAULTS = {
|
|
2717
|
+
crosspointOn: "audio-volume-ok",
|
|
2718
|
+
muteOff: "audio-volume-high",
|
|
2719
|
+
muteOn: "audio-volume-mute",
|
|
2720
|
+
muteOffFilter: "invert(65%) sepia(70%) saturate(500%) hue-rotate(80deg) brightness(110%) contrast(95%)",
|
|
2721
|
+
muteOnFilter: "brightness(0) invert(1)"
|
|
2722
|
+
};
|
|
2723
|
+
function mergeDefined(defaults4, overrides) {
|
|
2724
|
+
if (!overrides) return { ...defaults4 };
|
|
2725
|
+
const out = { ...defaults4 };
|
|
2726
|
+
Object.keys(overrides).forEach((k) => {
|
|
2727
|
+
const v = overrides[k];
|
|
2728
|
+
if (v !== void 0) out[k] = v;
|
|
2729
|
+
});
|
|
2730
|
+
return out;
|
|
2731
|
+
}
|
|
2732
|
+
function resolveDspClasses(classes) {
|
|
2733
|
+
return mergeDefined(DSP_CLASS_DEFAULTS, classes);
|
|
2734
|
+
}
|
|
2735
|
+
function resolveDspIcons(icons) {
|
|
2736
|
+
return mergeDefined(DSP_ICON_DEFAULTS, icons);
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
// src/components/dsp/CrisViewDspInputs.tsx
|
|
2740
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2741
|
+
function CrisViewDspInputs({
|
|
2742
|
+
oid,
|
|
2743
|
+
skip,
|
|
2744
|
+
emptyLabel = "Sin entradas",
|
|
2745
|
+
classes,
|
|
2746
|
+
icons,
|
|
2747
|
+
className
|
|
2748
|
+
}) {
|
|
2749
|
+
const status = useCustomObject4(oid, { subscribe: true });
|
|
2750
|
+
const send = useCustomObjectSend4();
|
|
2751
|
+
const cls = resolveDspClasses(classes);
|
|
2752
|
+
const ic = resolveDspIcons(icons);
|
|
2753
|
+
return /* @__PURE__ */ jsx14("div", { className: `w-full h-full ${className ?? ""}`, children: status === void 0 ? /* @__PURE__ */ jsx14("div", { className: cls.message, children: "Conectando\u2026" }) : /* @__PURE__ */ jsx14(
|
|
2754
|
+
DspIoPage,
|
|
2755
|
+
{
|
|
2756
|
+
status,
|
|
2757
|
+
io: "in",
|
|
2758
|
+
oid,
|
|
2759
|
+
send,
|
|
2760
|
+
skip,
|
|
2761
|
+
cls,
|
|
2762
|
+
icons: ic,
|
|
2763
|
+
emptyLabel
|
|
2764
|
+
}
|
|
2765
|
+
) });
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
// src/components/dsp/CrisViewDspOutputs.tsx
|
|
2769
|
+
import { useCustomObject as useCustomObject5, useCustomObjectSend as useCustomObjectSend5 } from "@imperosoft/cris-webui-ch5-core";
|
|
2770
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2771
|
+
function CrisViewDspOutputs({
|
|
2772
|
+
oid,
|
|
2773
|
+
skip,
|
|
2774
|
+
emptyLabel = "Sin salidas",
|
|
2775
|
+
classes,
|
|
2776
|
+
icons,
|
|
2777
|
+
className
|
|
2778
|
+
}) {
|
|
2779
|
+
const status = useCustomObject5(oid, { subscribe: true });
|
|
2780
|
+
const send = useCustomObjectSend5();
|
|
2781
|
+
const cls = resolveDspClasses(classes);
|
|
2782
|
+
const ic = resolveDspIcons(icons);
|
|
2783
|
+
return /* @__PURE__ */ jsx15("div", { className: `w-full h-full ${className ?? ""}`, children: status === void 0 ? /* @__PURE__ */ jsx15("div", { className: cls.message, children: "Conectando\u2026" }) : /* @__PURE__ */ jsx15(
|
|
2784
|
+
DspIoPage,
|
|
2785
|
+
{
|
|
2786
|
+
status,
|
|
2787
|
+
io: "out",
|
|
2788
|
+
oid,
|
|
2789
|
+
send,
|
|
2790
|
+
skip,
|
|
2791
|
+
cls,
|
|
2792
|
+
icons: ic,
|
|
2793
|
+
emptyLabel
|
|
2522
2794
|
}
|
|
2523
2795
|
) });
|
|
2524
2796
|
}
|
|
2525
2797
|
|
|
2798
|
+
// src/components/dsp/CrisViewDspMixer.tsx
|
|
2799
|
+
import { useCustomObject as useCustomObject6, useCustomObjectSend as useCustomObjectSend6 } from "@imperosoft/cris-webui-ch5-core";
|
|
2800
|
+
|
|
2526
2801
|
// src/components/dsp/DspMixer.tsx
|
|
2527
2802
|
import { useRef as useRef5 } from "react";
|
|
2528
|
-
import { Fragment as Fragment3, jsx as
|
|
2529
|
-
var
|
|
2530
|
-
var
|
|
2531
|
-
var
|
|
2532
|
-
var
|
|
2533
|
-
var
|
|
2534
|
-
var
|
|
2803
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2804
|
+
var DEFAULT_GROUP_W = "2.6em";
|
|
2805
|
+
var DEFAULT_COMMON_W = "9em";
|
|
2806
|
+
var DEFAULT_CHAN_W = "3em";
|
|
2807
|
+
var DEFAULT_GROUP_H = "2.2em";
|
|
2808
|
+
var DEFAULT_COMMON_H = "2.4em";
|
|
2809
|
+
var DEFAULT_CHAN_H = "2.1em";
|
|
2810
|
+
var DEFAULT_CELL_W = "7.5em";
|
|
2811
|
+
var DEFAULT_ROW_H = "4.5em";
|
|
2535
2812
|
var DRAG_FACTOR = 0.6;
|
|
2813
|
+
function resolveGeometry(o, inputCount, outputCount) {
|
|
2814
|
+
const groupW = o?.groupW ?? DEFAULT_GROUP_W;
|
|
2815
|
+
const commonW = o?.commonW ?? DEFAULT_COMMON_W;
|
|
2816
|
+
const chanW = o?.chanW ?? DEFAULT_CHAN_W;
|
|
2817
|
+
const groupH = o?.groupH ?? DEFAULT_GROUP_H;
|
|
2818
|
+
const commonH = o?.commonH ?? DEFAULT_COMMON_H;
|
|
2819
|
+
const chanH = o?.chanH ?? DEFAULT_CHAN_H;
|
|
2820
|
+
const cellW = o?.cellW ?? DEFAULT_CELL_W;
|
|
2821
|
+
const rowH = o?.rowH ?? DEFAULT_ROW_H;
|
|
2822
|
+
return {
|
|
2823
|
+
groupW,
|
|
2824
|
+
commonW,
|
|
2825
|
+
chanW,
|
|
2826
|
+
groupH,
|
|
2827
|
+
commonH,
|
|
2828
|
+
chanH,
|
|
2829
|
+
cellW,
|
|
2830
|
+
rowH,
|
|
2831
|
+
topLink: groupH,
|
|
2832
|
+
topChan: `calc(${groupH} + ${commonH})`,
|
|
2833
|
+
leftLink: groupW,
|
|
2834
|
+
leftChan: `calc(${groupW} + ${commonW})`,
|
|
2835
|
+
z: { corner: 40, group: 30, link: 25, chan: 20 },
|
|
2836
|
+
inputCount,
|
|
2837
|
+
outputCount
|
|
2838
|
+
};
|
|
2839
|
+
}
|
|
2536
2840
|
function CrosspointOnIcon({ icon }) {
|
|
2537
|
-
if (typeof icon !== "string") return /* @__PURE__ */
|
|
2538
|
-
return /* @__PURE__ */
|
|
2841
|
+
if (typeof icon !== "string") return /* @__PURE__ */ jsx16(Fragment3, { children: icon });
|
|
2842
|
+
return /* @__PURE__ */ jsx16(
|
|
2539
2843
|
"img",
|
|
2540
2844
|
{
|
|
2541
2845
|
src: getIconUrl(icon),
|
|
@@ -2546,7 +2850,17 @@ function CrosspointOnIcon({ icon }) {
|
|
|
2546
2850
|
}
|
|
2547
2851
|
);
|
|
2548
2852
|
}
|
|
2549
|
-
function DspMixer({
|
|
2853
|
+
function DspMixer({
|
|
2854
|
+
status,
|
|
2855
|
+
oid,
|
|
2856
|
+
send,
|
|
2857
|
+
cls,
|
|
2858
|
+
icons,
|
|
2859
|
+
geometry,
|
|
2860
|
+
renderInputHeader,
|
|
2861
|
+
renderOutputHeader,
|
|
2862
|
+
renderCorner
|
|
2863
|
+
}) {
|
|
2550
2864
|
const scrollRef = useRef5(null);
|
|
2551
2865
|
const startRef = useRef5(null);
|
|
2552
2866
|
const movedRef = useRef5(false);
|
|
@@ -2594,11 +2908,170 @@ function DspMixer({ status, oid, send, cls, icons }) {
|
|
|
2594
2908
|
pendingRef.current = null;
|
|
2595
2909
|
};
|
|
2596
2910
|
if (inputs.length === 0 || outputs.length === 0) {
|
|
2597
|
-
return /* @__PURE__ */
|
|
2911
|
+
return /* @__PURE__ */ jsx16("div", { className: cls.message, children: "Sin crosspoints" });
|
|
2598
2912
|
}
|
|
2599
|
-
const
|
|
2600
|
-
const
|
|
2601
|
-
|
|
2913
|
+
const geom = resolveGeometry(geometry, inputs.length, outputs.length);
|
|
2914
|
+
const inAxis = buildMixerAxisGrouped(inputs, linksFor(status?.ln, "in"), groupsFor(status?.dg, "in"));
|
|
2915
|
+
const outAxis = buildMixerAxisGrouped(outputs, linksFor(status?.ln, "out"), groupsFor(status?.dg, "out"));
|
|
2916
|
+
const { topLink, topChan, leftLink, leftChan, z: Z } = geom;
|
|
2917
|
+
const defaultInputHeader = () => inAxis.flatMap((it, ii) => {
|
|
2918
|
+
const col = 4 + ii;
|
|
2919
|
+
const nodes = [];
|
|
2920
|
+
if (it.groupStart) {
|
|
2921
|
+
nodes.push(
|
|
2922
|
+
/* @__PURE__ */ jsx16(
|
|
2923
|
+
"div",
|
|
2924
|
+
{
|
|
2925
|
+
className: cls.mixerGroup,
|
|
2926
|
+
style: { top: 0, zIndex: Z.group, gridRow: 1, gridColumn: `${col} / span ${it.groupSpan}` },
|
|
2927
|
+
title: it.groupName,
|
|
2928
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2 px-[0.2em]", children: it.groupName })
|
|
2929
|
+
},
|
|
2930
|
+
`igrp:${it.id}`
|
|
2931
|
+
)
|
|
2932
|
+
);
|
|
2933
|
+
} else if (it.groupName === void 0) {
|
|
2934
|
+
nodes.push(
|
|
2935
|
+
/* @__PURE__ */ jsx16(
|
|
2936
|
+
"div",
|
|
2937
|
+
{
|
|
2938
|
+
className: cls.mixerChrome,
|
|
2939
|
+
style: { top: 0, zIndex: Z.group, gridRow: 1, gridColumn: col }
|
|
2940
|
+
},
|
|
2941
|
+
`ifill:${it.id}`
|
|
2942
|
+
)
|
|
2943
|
+
);
|
|
2944
|
+
}
|
|
2945
|
+
if (it.linkCommon !== void 0) {
|
|
2946
|
+
if (it.linkStart) {
|
|
2947
|
+
nodes.push(
|
|
2948
|
+
/* @__PURE__ */ jsx16(
|
|
2949
|
+
"div",
|
|
2950
|
+
{
|
|
2951
|
+
className: `${cls.mixerChrome} px-[0.2em] font-semibold`,
|
|
2952
|
+
style: { top: topLink, zIndex: Z.link, gridRow: 2, gridColumn: `${col} / span ${it.linkSpan}` },
|
|
2953
|
+
title: it.linkCommon,
|
|
2954
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2", children: it.linkCommon })
|
|
2955
|
+
},
|
|
2956
|
+
`ilnk:${it.id}`
|
|
2957
|
+
)
|
|
2958
|
+
);
|
|
2959
|
+
}
|
|
2960
|
+
nodes.push(
|
|
2961
|
+
/* @__PURE__ */ jsx16(
|
|
2962
|
+
"div",
|
|
2963
|
+
{
|
|
2964
|
+
className: `${cls.mixerChrome} px-[0.2em]`,
|
|
2965
|
+
style: { top: topChan, zIndex: Z.chan, gridRow: 3, gridColumn: col },
|
|
2966
|
+
title: it.channelLabel,
|
|
2967
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-1", children: it.channelLabel })
|
|
2968
|
+
},
|
|
2969
|
+
`ichn:${it.id}`
|
|
2970
|
+
)
|
|
2971
|
+
);
|
|
2972
|
+
} else {
|
|
2973
|
+
nodes.push(
|
|
2974
|
+
/* @__PURE__ */ jsx16(
|
|
2975
|
+
"div",
|
|
2976
|
+
{
|
|
2977
|
+
className: cls.mixerChrome,
|
|
2978
|
+
style: { top: topLink, zIndex: Z.link, gridRow: 2, gridColumn: col }
|
|
2979
|
+
},
|
|
2980
|
+
`ilf:${it.id}`
|
|
2981
|
+
),
|
|
2982
|
+
/* @__PURE__ */ jsx16(
|
|
2983
|
+
"div",
|
|
2984
|
+
{
|
|
2985
|
+
className: `${cls.mixerChrome} px-[0.2em]`,
|
|
2986
|
+
style: { top: topChan, zIndex: Z.chan, gridRow: 3, gridColumn: col },
|
|
2987
|
+
title: it.channelLabel,
|
|
2988
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2", children: it.channelLabel })
|
|
2989
|
+
},
|
|
2990
|
+
`ichn:${it.id}`
|
|
2991
|
+
)
|
|
2992
|
+
);
|
|
2993
|
+
}
|
|
2994
|
+
return nodes;
|
|
2995
|
+
});
|
|
2996
|
+
const defaultOutputHeader = () => outAxis.flatMap((it, oo) => {
|
|
2997
|
+
const row = 4 + oo;
|
|
2998
|
+
const nodes = [];
|
|
2999
|
+
if (it.groupStart) {
|
|
3000
|
+
nodes.push(
|
|
3001
|
+
/* @__PURE__ */ jsx16(
|
|
3002
|
+
"div",
|
|
3003
|
+
{
|
|
3004
|
+
className: cls.mixerGroupV,
|
|
3005
|
+
style: {
|
|
3006
|
+
left: 0,
|
|
3007
|
+
zIndex: Z.group,
|
|
3008
|
+
gridColumn: 1,
|
|
3009
|
+
gridRow: `${row} / span ${it.groupSpan}`,
|
|
3010
|
+
writingMode: "vertical-rl",
|
|
3011
|
+
transform: "rotate(180deg)"
|
|
3012
|
+
},
|
|
3013
|
+
title: it.groupName,
|
|
3014
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2", children: it.groupName })
|
|
3015
|
+
},
|
|
3016
|
+
`ogrp:${it.id}`
|
|
3017
|
+
)
|
|
3018
|
+
);
|
|
3019
|
+
} else if (it.groupName === void 0) {
|
|
3020
|
+
nodes.push(
|
|
3021
|
+
/* @__PURE__ */ jsx16(
|
|
3022
|
+
"div",
|
|
3023
|
+
{
|
|
3024
|
+
className: cls.mixerChrome,
|
|
3025
|
+
style: { left: 0, zIndex: Z.group, gridColumn: 1, gridRow: row }
|
|
3026
|
+
},
|
|
3027
|
+
`ofill:${it.id}`
|
|
3028
|
+
)
|
|
3029
|
+
);
|
|
3030
|
+
}
|
|
3031
|
+
if (it.linkCommon !== void 0) {
|
|
3032
|
+
if (it.linkStart) {
|
|
3033
|
+
nodes.push(
|
|
3034
|
+
/* @__PURE__ */ jsx16(
|
|
3035
|
+
"div",
|
|
3036
|
+
{
|
|
3037
|
+
className: `${cls.mixerChrome} justify-start px-[0.4em] font-semibold`,
|
|
3038
|
+
style: { left: leftLink, zIndex: Z.link, gridColumn: 2, gridRow: `${row} / span ${it.linkSpan}` },
|
|
3039
|
+
title: it.linkCommon,
|
|
3040
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2 text-left", children: it.linkCommon })
|
|
3041
|
+
},
|
|
3042
|
+
`olnk:${it.id}`
|
|
3043
|
+
)
|
|
3044
|
+
);
|
|
3045
|
+
}
|
|
3046
|
+
nodes.push(
|
|
3047
|
+
/* @__PURE__ */ jsx16(
|
|
3048
|
+
"div",
|
|
3049
|
+
{
|
|
3050
|
+
className: cls.mixerChrome,
|
|
3051
|
+
style: { left: leftChan, zIndex: Z.chan, gridColumn: 3, gridRow: row },
|
|
3052
|
+
title: it.channelLabel,
|
|
3053
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-1", children: it.channelLabel })
|
|
3054
|
+
},
|
|
3055
|
+
`ochn:${it.id}`
|
|
3056
|
+
)
|
|
3057
|
+
);
|
|
3058
|
+
} else {
|
|
3059
|
+
nodes.push(
|
|
3060
|
+
/* @__PURE__ */ jsx16(
|
|
3061
|
+
"div",
|
|
3062
|
+
{
|
|
3063
|
+
className: `${cls.mixerChrome} justify-start px-[0.4em]`,
|
|
3064
|
+
style: { left: leftLink, zIndex: Z.chan, gridColumn: "2 / span 2", gridRow: row },
|
|
3065
|
+
title: it.channelLabel,
|
|
3066
|
+
children: /* @__PURE__ */ jsx16("span", { className: "text-[1.1em] line-clamp-2 text-left", children: it.channelLabel })
|
|
3067
|
+
},
|
|
3068
|
+
`ochn:${it.id}`
|
|
3069
|
+
)
|
|
3070
|
+
);
|
|
3071
|
+
}
|
|
3072
|
+
return nodes;
|
|
3073
|
+
});
|
|
3074
|
+
return /* @__PURE__ */ jsx16(
|
|
2602
3075
|
"div",
|
|
2603
3076
|
{
|
|
2604
3077
|
ref: scrollRef,
|
|
@@ -2606,126 +3079,58 @@ function DspMixer({ status, oid, send, cls, icons }) {
|
|
|
2606
3079
|
onPointerMove,
|
|
2607
3080
|
onPointerUp,
|
|
2608
3081
|
onPointerCancel: onPointerUp,
|
|
2609
|
-
className: "w-full h-full overflow-auto no-scrollbar relative touch-none select-none cursor-grab",
|
|
2610
|
-
children: /* @__PURE__ */
|
|
3082
|
+
className: "w-full h-full overflow-auto no-scrollbar relative touch-none select-none cursor-grab flex",
|
|
3083
|
+
children: /* @__PURE__ */ jsxs12(
|
|
2611
3084
|
"div",
|
|
2612
3085
|
{
|
|
2613
|
-
className: "grid",
|
|
3086
|
+
className: "grid m-auto",
|
|
2614
3087
|
style: {
|
|
2615
|
-
// cols: [
|
|
2616
|
-
gridTemplateColumns: `${
|
|
2617
|
-
gridTemplateRows: `${
|
|
3088
|
+
// cols: [out group][out link][out channel][inputs…] rows: [in group][in link][in channel][outputs…]
|
|
3089
|
+
gridTemplateColumns: `${geom.groupW} ${geom.commonW} ${geom.chanW} repeat(${inputs.length}, ${geom.cellW})`,
|
|
3090
|
+
gridTemplateRows: `${geom.groupH} ${geom.commonH} ${geom.chanH} repeat(${outputs.length}, ${geom.rowH})`,
|
|
2618
3091
|
minWidth: "min-content"
|
|
2619
3092
|
},
|
|
2620
3093
|
children: [
|
|
2621
|
-
/* @__PURE__ */
|
|
3094
|
+
/* @__PURE__ */ jsx16(
|
|
2622
3095
|
"div",
|
|
2623
3096
|
{
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
3097
|
+
"aria-hidden": true,
|
|
3098
|
+
className: `sticky ${cls.mixerBackplate}`,
|
|
3099
|
+
style: { top: 0, zIndex: 15, gridColumn: "1 / -1", gridRow: "1 / span 3" }
|
|
2627
3100
|
}
|
|
2628
3101
|
),
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
{
|
|
2636
|
-
className: `${cls.mixerChrome} z-20 px-[0.2em]`,
|
|
2637
|
-
style: { top: 0, gridRow: "1 / span 2", gridColumn: col, alignItems: "flex-end", paddingBottom: "0.3em" },
|
|
2638
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-1", children: it.channelLabel })
|
|
2639
|
-
},
|
|
2640
|
-
`ich:${it.id}`
|
|
2641
|
-
)
|
|
2642
|
-
];
|
|
2643
|
-
if (it.groupStart) {
|
|
2644
|
-
nodes.unshift(
|
|
2645
|
-
/* @__PURE__ */ jsx14(
|
|
2646
|
-
"div",
|
|
2647
|
-
{
|
|
2648
|
-
className: `${cls.mixerChrome} z-25 px-[0.2em] font-semibold`,
|
|
2649
|
-
style: { top: 0, gridRow: 1, gridColumn: `${col} / span ${it.groupSpan}` },
|
|
2650
|
-
title: it.groupCommon,
|
|
2651
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-2", children: it.groupCommon })
|
|
2652
|
-
},
|
|
2653
|
-
`icc:${it.id}`
|
|
2654
|
-
)
|
|
2655
|
-
);
|
|
2656
|
-
}
|
|
2657
|
-
return nodes;
|
|
3102
|
+
/* @__PURE__ */ jsx16(
|
|
3103
|
+
"div",
|
|
3104
|
+
{
|
|
3105
|
+
"aria-hidden": true,
|
|
3106
|
+
className: `sticky ${cls.mixerBackplate}`,
|
|
3107
|
+
style: { left: 0, zIndex: 15, gridColumn: "1 / span 3", gridRow: "1 / -1" }
|
|
2658
3108
|
}
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-3", children: it.channelLabel })
|
|
2667
|
-
},
|
|
2668
|
-
`is:${it.id}`
|
|
2669
|
-
)
|
|
2670
|
-
];
|
|
2671
|
-
}),
|
|
2672
|
-
outAxis.flatMap((it, oo) => {
|
|
2673
|
-
const row = 3 + oo;
|
|
2674
|
-
if (it.groupCommon !== void 0) {
|
|
2675
|
-
const nodes = [
|
|
2676
|
-
/* @__PURE__ */ jsx14(
|
|
2677
|
-
"div",
|
|
2678
|
-
{
|
|
2679
|
-
className: `${cls.mixerChrome} z-20`,
|
|
2680
|
-
style: { left: 0, gridColumn: "1 / span 2", gridRow: row, justifyContent: "flex-end", paddingRight: "0.6em" },
|
|
2681
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-1", children: it.channelLabel })
|
|
2682
|
-
},
|
|
2683
|
-
`och:${it.id}`
|
|
2684
|
-
)
|
|
2685
|
-
];
|
|
2686
|
-
if (it.groupStart) {
|
|
2687
|
-
nodes.unshift(
|
|
2688
|
-
/* @__PURE__ */ jsx14(
|
|
2689
|
-
"div",
|
|
2690
|
-
{
|
|
2691
|
-
className: `${cls.mixerChrome} z-25 justify-start px-[0.4em] font-semibold`,
|
|
2692
|
-
style: { left: 0, gridColumn: 1, gridRow: `${row} / span ${it.groupSpan}` },
|
|
2693
|
-
title: it.groupCommon,
|
|
2694
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-2 text-left", children: it.groupCommon })
|
|
2695
|
-
},
|
|
2696
|
-
`occ:${it.id}`
|
|
2697
|
-
)
|
|
2698
|
-
);
|
|
2699
|
-
}
|
|
2700
|
-
return nodes;
|
|
3109
|
+
),
|
|
3110
|
+
/* @__PURE__ */ jsx16(
|
|
3111
|
+
"div",
|
|
3112
|
+
{
|
|
3113
|
+
className: cls.mixerCorner,
|
|
3114
|
+
style: { top: 0, left: 0, zIndex: Z.corner, gridColumn: "1 / span 3", gridRow: "1 / span 3" },
|
|
3115
|
+
children: renderCorner ? renderCorner(geom) : "OUT \\ IN"
|
|
2701
3116
|
}
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
children: /* @__PURE__ */ jsx14("span", { className: "line-clamp-2 text-left", children: it.channelLabel })
|
|
2710
|
-
},
|
|
2711
|
-
`os:${it.id}`
|
|
2712
|
-
)
|
|
2713
|
-
];
|
|
2714
|
-
}),
|
|
2715
|
-
outputs.map(
|
|
2716
|
-
(o, oo) => inputs.map((i, ii) => {
|
|
2717
|
-
const on = isOn(o.id, i.id);
|
|
2718
|
-
return /* @__PURE__ */ jsx14(
|
|
3117
|
+
),
|
|
3118
|
+
renderInputHeader ? renderInputHeader(inAxis, geom) : defaultInputHeader(),
|
|
3119
|
+
renderOutputHeader ? renderOutputHeader(outAxis, geom) : defaultOutputHeader(),
|
|
3120
|
+
outAxis.map(
|
|
3121
|
+
(orow, oo) => inAxis.map((icol, ii) => {
|
|
3122
|
+
const on = isOn(orow.id, icol.id);
|
|
3123
|
+
return /* @__PURE__ */ jsx16(
|
|
2719
3124
|
"div",
|
|
2720
3125
|
{
|
|
2721
3126
|
"data-cell": true,
|
|
2722
|
-
"data-in":
|
|
2723
|
-
"data-out":
|
|
3127
|
+
"data-in": icol.id,
|
|
3128
|
+
"data-out": orow.id,
|
|
2724
3129
|
className: `${cls.cell} ${on ? cls.cellOn : cls.cellOff}`,
|
|
2725
|
-
style: { gridColumn:
|
|
2726
|
-
children: on && /* @__PURE__ */
|
|
3130
|
+
style: { gridColumn: 4 + ii, gridRow: 4 + oo },
|
|
3131
|
+
children: on && /* @__PURE__ */ jsx16(CrosspointOnIcon, { icon: icons.crosspointOn })
|
|
2727
3132
|
},
|
|
2728
|
-
`x:${
|
|
3133
|
+
`x:${icol.id}:${orow.id}`
|
|
2729
3134
|
);
|
|
2730
3135
|
})
|
|
2731
3136
|
)
|
|
@@ -2736,13 +3141,45 @@ function DspMixer({ status, oid, send, cls, icons }) {
|
|
|
2736
3141
|
);
|
|
2737
3142
|
}
|
|
2738
3143
|
|
|
3144
|
+
// src/components/dsp/CrisViewDspMixer.tsx
|
|
3145
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
3146
|
+
function CrisViewDspMixer({
|
|
3147
|
+
oid,
|
|
3148
|
+
classes,
|
|
3149
|
+
icons,
|
|
3150
|
+
className,
|
|
3151
|
+
geometry,
|
|
3152
|
+
renderInputHeader,
|
|
3153
|
+
renderOutputHeader,
|
|
3154
|
+
renderCorner
|
|
3155
|
+
}) {
|
|
3156
|
+
const status = useCustomObject6(oid, { subscribe: true });
|
|
3157
|
+
const send = useCustomObjectSend6();
|
|
3158
|
+
const cls = resolveDspClasses(classes);
|
|
3159
|
+
const ic = resolveDspIcons(icons);
|
|
3160
|
+
return /* @__PURE__ */ jsx17("div", { className: `w-full h-full ${className ?? ""}`, children: status === void 0 ? /* @__PURE__ */ jsx17("div", { className: cls.message, children: "Conectando\u2026" }) : /* @__PURE__ */ jsx17(
|
|
3161
|
+
DspMixer,
|
|
3162
|
+
{
|
|
3163
|
+
status,
|
|
3164
|
+
oid,
|
|
3165
|
+
send,
|
|
3166
|
+
cls,
|
|
3167
|
+
icons: ic,
|
|
3168
|
+
geometry,
|
|
3169
|
+
renderInputHeader,
|
|
3170
|
+
renderOutputHeader,
|
|
3171
|
+
renderCorner
|
|
3172
|
+
}
|
|
3173
|
+
) });
|
|
3174
|
+
}
|
|
3175
|
+
|
|
2739
3176
|
// src/components/dsp/DspPresets.tsx
|
|
2740
3177
|
import { useRef as useRef6, useState as useState5 } from "react";
|
|
2741
|
-
import { jsx as
|
|
3178
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2742
3179
|
var HOLD_MS = 2e3;
|
|
2743
3180
|
var SAVED_MS = 1e3;
|
|
2744
3181
|
function PresetButton({ num, name, active, onCall, onSave, cls }) {
|
|
2745
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsx18(
|
|
2746
3183
|
CrisButton,
|
|
2747
3184
|
{
|
|
2748
3185
|
onTap: onCall,
|
|
@@ -2752,9 +3189,9 @@ function PresetButton({ num, name, active, onCall, onSave, cls }) {
|
|
|
2752
3189
|
className: cls.preset,
|
|
2753
3190
|
classActive: cls.presetActive,
|
|
2754
3191
|
classPressed: cls.presetPressed,
|
|
2755
|
-
children: /* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
3192
|
+
children: /* @__PURE__ */ jsxs13("span", { className: "flex items-center justify-center gap-[0.5em]", children: [
|
|
3193
|
+
/* @__PURE__ */ jsx18("span", { className: "text-[1.6em] font-bold leading-none", children: num }),
|
|
3194
|
+
/* @__PURE__ */ jsx18("span", { className: "text-[1.2em] leading-none", children: name })
|
|
2758
3195
|
] })
|
|
2759
3196
|
}
|
|
2760
3197
|
);
|
|
@@ -2781,10 +3218,10 @@ function DspPresets({
|
|
|
2781
3218
|
if (!sustainedFeedback) return false;
|
|
2782
3219
|
return p.kind === "local" ? activeLocal === p.id : activeDevice === p.id;
|
|
2783
3220
|
};
|
|
2784
|
-
return /* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2787
|
-
presets.map((p) => /* @__PURE__ */
|
|
3221
|
+
return /* @__PURE__ */ jsxs13("div", { className: cls.presetWrap, children: [
|
|
3222
|
+
/* @__PURE__ */ jsx18("span", { className: cls.presetLabel, children: "Preset" }),
|
|
3223
|
+
/* @__PURE__ */ jsxs13("div", { className: "relative flex-1 flex items-stretch gap-[0.3em] mt-[0.25em]", children: [
|
|
3224
|
+
presets.map((p) => /* @__PURE__ */ jsx18(
|
|
2788
3225
|
PresetButton,
|
|
2789
3226
|
{
|
|
2790
3227
|
num: p.id,
|
|
@@ -2796,64 +3233,14 @@ function DspPresets({
|
|
|
2796
3233
|
},
|
|
2797
3234
|
p.id
|
|
2798
3235
|
)),
|
|
2799
|
-
saved && /* @__PURE__ */
|
|
3236
|
+
saved && /* @__PURE__ */ jsx18("div", { className: cls.savedFlash, children: "Saved" })
|
|
2800
3237
|
] })
|
|
2801
3238
|
] });
|
|
2802
3239
|
}
|
|
2803
3240
|
|
|
2804
|
-
// src/components/dsp/dspClasses.ts
|
|
2805
|
-
var DSP_CLASS_DEFAULTS = {
|
|
2806
|
-
root: "w-full h-full flex flex-col",
|
|
2807
|
-
header: "relative w-full flex items-end justify-center gap-[0.3em] px-[1em] pt-[0.5em]",
|
|
2808
|
-
content: "w-full flex-1 min-h-0",
|
|
2809
|
-
tab: "w-[10.5em] h-[3.25em] rounded-b-none rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white text-[1.4em] font-bold",
|
|
2810
|
-
tabActive: "bg-[#007ca0]",
|
|
2811
|
-
message: "w-full h-full flex items-center justify-center text-gray-400 text-[2em]",
|
|
2812
|
-
presetWrap: "absolute left-[1em] bottom-[0.3em] h-[4.5em] flex flex-col items-center",
|
|
2813
|
-
presetLabel: "text-[#4f5152] text-[1.4em] leading-none",
|
|
2814
|
-
preset: "w-[8em] h-full rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white",
|
|
2815
|
-
presetActive: "bg-[#007ca0]",
|
|
2816
|
-
presetPressed: "bg-[#006080]",
|
|
2817
|
-
savedFlash: "absolute inset-0 flex items-center justify-center rounded bg-[#22c55e] text-white text-[1.2em] font-bold pointer-events-none",
|
|
2818
|
-
strip: "flex flex-col items-center gap-[0.4em] h-full w-[9em] flex-none px-[0.3em]",
|
|
2819
|
-
stripLabel: "text-[#4f5152] text-center leading-tight text-[1.1em] line-clamp-3",
|
|
2820
|
-
levelReadout: "text-[1.1em] text-[#4f5152] leading-none opacity-70 mt-[0.5em]",
|
|
2821
|
-
faderBar: "bg-[#c0c0c0] rounded",
|
|
2822
|
-
faderFill: "bg-[#007ca0] rounded",
|
|
2823
|
-
faderThumb: "bg-[#4f5152] rounded",
|
|
2824
|
-
mute: "w-full h-full rounded-lg flex items-center justify-center transition-colors bg-[#4f5152] text-white",
|
|
2825
|
-
muteActive: "bg-[#dc2626] text-white",
|
|
2826
|
-
mixerCorner: "sticky z-30 flex items-center justify-center bg-[#282C34] text-[#4f5152] text-[1.1em] font-bold border border-black/30",
|
|
2827
|
-
mixerChrome: "sticky flex items-center justify-center text-center bg-[#282C34] text-white text-[1.1em] leading-tight border border-black/30",
|
|
2828
|
-
cell: "z-10 flex items-center justify-center border border-black/30",
|
|
2829
|
-
cellOn: "bg-[#22c55e]",
|
|
2830
|
-
cellOff: "bg-[#4f5152]"
|
|
2831
|
-
};
|
|
2832
|
-
var DSP_ICON_DEFAULTS = {
|
|
2833
|
-
crosspointOn: "audio-volume-ok",
|
|
2834
|
-
muteOff: "audio-volume-high",
|
|
2835
|
-
muteOn: "audio-volume-mute",
|
|
2836
|
-
muteOffFilter: "invert(65%) sepia(70%) saturate(500%) hue-rotate(80deg) brightness(110%) contrast(95%)",
|
|
2837
|
-
muteOnFilter: "brightness(0) invert(1)"
|
|
2838
|
-
};
|
|
2839
|
-
function mergeDefined(defaults4, overrides) {
|
|
2840
|
-
if (!overrides) return { ...defaults4 };
|
|
2841
|
-
const out = { ...defaults4 };
|
|
2842
|
-
Object.keys(overrides).forEach((k) => {
|
|
2843
|
-
const v = overrides[k];
|
|
2844
|
-
if (v !== void 0) out[k] = v;
|
|
2845
|
-
});
|
|
2846
|
-
return out;
|
|
2847
|
-
}
|
|
2848
|
-
function resolveDspClasses(classes) {
|
|
2849
|
-
return mergeDefined(DSP_CLASS_DEFAULTS, classes);
|
|
2850
|
-
}
|
|
2851
|
-
function resolveDspIcons(icons) {
|
|
2852
|
-
return mergeDefined(DSP_ICON_DEFAULTS, icons);
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
3241
|
// src/components/dsp/CrisViewDspFull.tsx
|
|
2856
|
-
import { Fragment as Fragment4, jsx as
|
|
3242
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3243
|
+
var lastTabByOid = /* @__PURE__ */ new Map();
|
|
2857
3244
|
function CrisViewDspFull({
|
|
2858
3245
|
oid,
|
|
2859
3246
|
presets,
|
|
@@ -2866,12 +3253,16 @@ function CrisViewDspFull({
|
|
|
2866
3253
|
className,
|
|
2867
3254
|
initialTab = "in"
|
|
2868
3255
|
}) {
|
|
2869
|
-
const
|
|
2870
|
-
const
|
|
2871
|
-
const
|
|
2872
|
-
const
|
|
3256
|
+
const remembered = lastTabByOid.get(oid) ?? initialTab;
|
|
3257
|
+
const safeInitial = remembered === "mix" && skipCrosspoints ? "in" : remembered;
|
|
3258
|
+
const [tab, setTabState] = useState6(safeInitial);
|
|
3259
|
+
const setTab = (t) => {
|
|
3260
|
+
lastTabByOid.set(oid, t);
|
|
3261
|
+
setTabState(t);
|
|
3262
|
+
};
|
|
3263
|
+
const status = useCustomObject7(oid, { subscribe: true });
|
|
3264
|
+
const send = useCustomObjectSend7();
|
|
2873
3265
|
const cls = resolveDspClasses(classes);
|
|
2874
|
-
const ic = resolveDspIcons(icons);
|
|
2875
3266
|
const tabs = [
|
|
2876
3267
|
{ id: "in", label: "Inputs" },
|
|
2877
3268
|
...skipCrosspoints ? [] : [{ id: "mix", label: "Mixer" }],
|
|
@@ -2880,9 +3271,9 @@ function CrisViewDspFull({
|
|
|
2880
3271
|
const hasPresets = !!presets && presets.length > 0;
|
|
2881
3272
|
const activeDevice = status?.pr?.dv ?? status?.ps?.dv;
|
|
2882
3273
|
const activeLocal = status?.pr?.lc ?? status?.ps?.lc;
|
|
2883
|
-
return /* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
hasPresets && /* @__PURE__ */
|
|
3274
|
+
return /* @__PURE__ */ jsxs14("div", { className: `${cls.root} ${className ?? ""}`, children: [
|
|
3275
|
+
/* @__PURE__ */ jsxs14("div", { className: cls.header, children: [
|
|
3276
|
+
hasPresets && /* @__PURE__ */ jsx19(
|
|
2886
3277
|
DspPresets,
|
|
2887
3278
|
{
|
|
2888
3279
|
oid,
|
|
@@ -2894,7 +3285,7 @@ function CrisViewDspFull({
|
|
|
2894
3285
|
cls
|
|
2895
3286
|
}
|
|
2896
3287
|
),
|
|
2897
|
-
tabs.map((t) => /* @__PURE__ */
|
|
3288
|
+
tabs.map((t) => /* @__PURE__ */ jsx19(
|
|
2898
3289
|
CrisButton,
|
|
2899
3290
|
{
|
|
2900
3291
|
text: t.label,
|
|
@@ -2905,39 +3296,82 @@ function CrisViewDspFull({
|
|
|
2905
3296
|
},
|
|
2906
3297
|
t.id
|
|
2907
3298
|
)),
|
|
2908
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ jsx19(CrisViewComm, { comm: status?.cm, className: "absolute right-[1em] bottom-[0.3em] text-[1.25em]" })
|
|
2909
3300
|
] }),
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
tab === "in" && /* @__PURE__ */
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
status,
|
|
2915
|
-
io: "in",
|
|
2916
|
-
oid,
|
|
2917
|
-
send,
|
|
2918
|
-
skip: skipShowInput,
|
|
2919
|
-
cls,
|
|
2920
|
-
icons: ic,
|
|
2921
|
-
emptyLabel: "Sin entradas"
|
|
2922
|
-
}
|
|
2923
|
-
),
|
|
2924
|
-
tab === "mix" && !skipCrosspoints && /* @__PURE__ */ jsx16(DspMixer, { status, oid, send, cls, icons: ic }),
|
|
2925
|
-
tab === "out" && /* @__PURE__ */ jsx16(
|
|
2926
|
-
DspIoPage,
|
|
2927
|
-
{
|
|
2928
|
-
status,
|
|
2929
|
-
io: "out",
|
|
2930
|
-
oid,
|
|
2931
|
-
send,
|
|
2932
|
-
skip: skipShowOutput,
|
|
2933
|
-
cls,
|
|
2934
|
-
icons: ic,
|
|
2935
|
-
emptyLabel: "Sin salidas"
|
|
2936
|
-
}
|
|
2937
|
-
)
|
|
3301
|
+
/* @__PURE__ */ jsx19("div", { className: cls.content, children: status === void 0 ? /* @__PURE__ */ jsx19("div", { className: cls.message, children: "Conectando\u2026" }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
3302
|
+
tab === "in" && /* @__PURE__ */ jsx19(CrisViewDspInputs, { oid, skip: skipShowInput, classes, icons }),
|
|
3303
|
+
tab === "mix" && !skipCrosspoints && /* @__PURE__ */ jsx19(CrisViewDspMixer, { oid, classes, icons }),
|
|
3304
|
+
tab === "out" && /* @__PURE__ */ jsx19(CrisViewDspOutputs, { oid, skip: skipShowOutput, classes, icons })
|
|
2938
3305
|
] }) })
|
|
2939
3306
|
] });
|
|
2940
3307
|
}
|
|
3308
|
+
|
|
3309
|
+
// src/components/dsp/CrisViewDspPresets.tsx
|
|
3310
|
+
import { useCustomObject as useCustomObject8, useCustomObjectSend as useCustomObjectSend8 } from "@imperosoft/cris-webui-ch5-core";
|
|
3311
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
3312
|
+
function CrisViewDspPresets({
|
|
3313
|
+
oid,
|
|
3314
|
+
presets,
|
|
3315
|
+
sustainedPresetFeedback = true,
|
|
3316
|
+
classes,
|
|
3317
|
+
className
|
|
3318
|
+
}) {
|
|
3319
|
+
const status = useCustomObject8(oid, { subscribe: true });
|
|
3320
|
+
const send = useCustomObjectSend8();
|
|
3321
|
+
const cls = resolveDspClasses({ presetWrap: "flex flex-col items-center", ...classes });
|
|
3322
|
+
const activeDevice = status?.pr?.dv ?? status?.ps?.dv;
|
|
3323
|
+
const activeLocal = status?.pr?.lc ?? status?.ps?.lc;
|
|
3324
|
+
return /* @__PURE__ */ jsx20("div", { className, children: /* @__PURE__ */ jsx20(
|
|
3325
|
+
DspPresets,
|
|
3326
|
+
{
|
|
3327
|
+
oid,
|
|
3328
|
+
send,
|
|
3329
|
+
presets,
|
|
3330
|
+
activeDevice,
|
|
3331
|
+
activeLocal,
|
|
3332
|
+
sustainedFeedback: sustainedPresetFeedback,
|
|
3333
|
+
cls
|
|
3334
|
+
}
|
|
3335
|
+
) });
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
// src/components/dsp/CrisViewDspChannels.tsx
|
|
3339
|
+
import { useCustomObject as useCustomObject9, useCustomObjectSend as useCustomObjectSend9 } from "@imperosoft/cris-webui-ch5-core";
|
|
3340
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3341
|
+
function CrisViewDspChannels({
|
|
3342
|
+
oid,
|
|
3343
|
+
io,
|
|
3344
|
+
show,
|
|
3345
|
+
scroll = false,
|
|
3346
|
+
showEmpty = false,
|
|
3347
|
+
emptyLabel = "",
|
|
3348
|
+
classes,
|
|
3349
|
+
icons,
|
|
3350
|
+
className
|
|
3351
|
+
}) {
|
|
3352
|
+
const status = useCustomObject9(oid, { subscribe: true });
|
|
3353
|
+
const send = useCustomObjectSend9();
|
|
3354
|
+
const cls = resolveDspClasses(classes);
|
|
3355
|
+
const ic = resolveDspIcons(icons);
|
|
3356
|
+
if (status === void 0) {
|
|
3357
|
+
return showEmpty ? /* @__PURE__ */ jsx21("div", { className: cls.message, children: "Conectando\u2026" }) : null;
|
|
3358
|
+
}
|
|
3359
|
+
return /* @__PURE__ */ jsx21("div", { className, children: /* @__PURE__ */ jsx21(
|
|
3360
|
+
DspIoPage,
|
|
3361
|
+
{
|
|
3362
|
+
status,
|
|
3363
|
+
io,
|
|
3364
|
+
oid,
|
|
3365
|
+
send,
|
|
3366
|
+
show,
|
|
3367
|
+
cls,
|
|
3368
|
+
icons: ic,
|
|
3369
|
+
emptyLabel,
|
|
3370
|
+
bare: !scroll,
|
|
3371
|
+
suppressEmpty: !showEmpty
|
|
3372
|
+
}
|
|
3373
|
+
) });
|
|
3374
|
+
}
|
|
2941
3375
|
export {
|
|
2942
3376
|
CrisButton,
|
|
2943
3377
|
CrisCoDebug,
|
|
@@ -2950,8 +3384,15 @@ export {
|
|
|
2950
3384
|
CrisText,
|
|
2951
3385
|
CrisTextInput,
|
|
2952
3386
|
CrisViewComm,
|
|
3387
|
+
CrisViewDspChannels,
|
|
2953
3388
|
CrisViewDspFull,
|
|
3389
|
+
CrisViewDspInputs,
|
|
3390
|
+
CrisViewDspMixer,
|
|
3391
|
+
CrisViewDspOutputs,
|
|
3392
|
+
CrisViewDspPresets,
|
|
3393
|
+
buildIoSections,
|
|
2954
3394
|
buildMixerAxis,
|
|
3395
|
+
buildMixerAxisGrouped,
|
|
2955
3396
|
clampLevel,
|
|
2956
3397
|
collapseStrips,
|
|
2957
3398
|
commIndicators,
|
|
@@ -2959,6 +3400,7 @@ export {
|
|
|
2959
3400
|
getIconConfig,
|
|
2960
3401
|
getIconFilter,
|
|
2961
3402
|
getIconUrl,
|
|
3403
|
+
groupsFor,
|
|
2962
3404
|
levelToPercent,
|
|
2963
3405
|
linksFor,
|
|
2964
3406
|
normalizeLinked
|