@signalsandsorcery/plugin-sdk 2.40.1 → 2.40.2
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 +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2524,6 +2524,7 @@ function TrackRow({
|
|
|
2524
2524
|
onImportSound,
|
|
2525
2525
|
importSoundLabel,
|
|
2526
2526
|
linkedSoundHint,
|
|
2527
|
+
onSyncSoundToGroup,
|
|
2527
2528
|
editNotes,
|
|
2528
2529
|
onNotesChange,
|
|
2529
2530
|
editBars,
|
|
@@ -2711,6 +2712,17 @@ function TrackRow({
|
|
|
2711
2712
|
]
|
|
2712
2713
|
}
|
|
2713
2714
|
),
|
|
2715
|
+
onSyncSoundToGroup && /* @__PURE__ */ jsx13(
|
|
2716
|
+
"button",
|
|
2717
|
+
{
|
|
2718
|
+
"data-testid": "sdk-sync-sound-button",
|
|
2719
|
+
onClick: onSyncSoundToGroup,
|
|
2720
|
+
disabled: isGenerating,
|
|
2721
|
+
className: `px-1.5 py-0.5 rounded-sm text-xs font-medium transition-colors border whitespace-nowrap ${isGenerating ? "bg-sas-panel border-sas-border text-sas-muted/30 cursor-not-allowed" : "bg-sas-panel-alt border-sas-border text-sas-muted hover:border-sas-accent hover:text-sas-accent"}`,
|
|
2722
|
+
title: "Apply THIS part's current sound to all linked parts \u2014 use after picking a patch inside the plugin's own editor",
|
|
2723
|
+
children: "\u2192 All"
|
|
2724
|
+
}
|
|
2725
|
+
),
|
|
2714
2726
|
freezeBadge && /* @__PURE__ */ jsx13(
|
|
2715
2727
|
"span",
|
|
2716
2728
|
{
|
|
@@ -7706,6 +7718,26 @@ function useGeneratorPanelCore({
|
|
|
7706
7718
|
},
|
|
7707
7719
|
[adapter, makeServices, host, logTag]
|
|
7708
7720
|
);
|
|
7721
|
+
const handleSyncSoundToGroup = useCallback17(
|
|
7722
|
+
async (trackId) => {
|
|
7723
|
+
const track = tracksRef.current.find((t) => t.handle.id === trackId);
|
|
7724
|
+
if (!track) return;
|
|
7725
|
+
let cap = null;
|
|
7726
|
+
try {
|
|
7727
|
+
cap = await adapter.sound.captureSoundDescriptor(trackId);
|
|
7728
|
+
} catch {
|
|
7729
|
+
cap = null;
|
|
7730
|
+
}
|
|
7731
|
+
if (!cap) {
|
|
7732
|
+
host.showToast("warning", "Nothing to sync", "This track has no sound to copy yet.");
|
|
7733
|
+
return;
|
|
7734
|
+
}
|
|
7735
|
+
const hist = soundHistory.list(trackId);
|
|
7736
|
+
const label = (hist.cursor >= 0 ? hist.entries[hist.cursor]?.label : void 0) ?? track.instrumentName ?? "Current sound";
|
|
7737
|
+
await broadcastSoundFromTrack(trackId, cap.descriptor, label);
|
|
7738
|
+
},
|
|
7739
|
+
[adapter, soundHistory, host, broadcastSoundFromTrack]
|
|
7740
|
+
);
|
|
7709
7741
|
const handleRestoreSound = useCallback17(
|
|
7710
7742
|
async (trackId, index) => {
|
|
7711
7743
|
const entry = soundHistory.list(trackId).entries[index];
|
|
@@ -8247,6 +8279,9 @@ function useGeneratorPanelCore({
|
|
|
8247
8279
|
shuffle: (trackId) => {
|
|
8248
8280
|
void handleShuffle(trackId);
|
|
8249
8281
|
},
|
|
8282
|
+
syncSoundToGroup: (trackId) => {
|
|
8283
|
+
void handleSyncSoundToGroup(trackId);
|
|
8284
|
+
},
|
|
8250
8285
|
copy: (trackId) => {
|
|
8251
8286
|
void handleCopy(trackId);
|
|
8252
8287
|
},
|
|
@@ -8267,6 +8302,7 @@ function useGeneratorPanelCore({
|
|
|
8267
8302
|
handlePromptChange,
|
|
8268
8303
|
handleGenerate,
|
|
8269
8304
|
handleShuffle,
|
|
8305
|
+
handleSyncSoundToGroup,
|
|
8270
8306
|
handleCopy,
|
|
8271
8307
|
handleDeleteTrack,
|
|
8272
8308
|
handleMuteToggle,
|
|
@@ -8325,6 +8361,7 @@ function useGeneratorPanelCore({
|
|
|
8325
8361
|
handleGenerate,
|
|
8326
8362
|
handleShuffle,
|
|
8327
8363
|
handleRestoreSound,
|
|
8364
|
+
handleSyncSoundToGroup,
|
|
8328
8365
|
handleAddTrack,
|
|
8329
8366
|
handleDeleteTrack,
|
|
8330
8367
|
handleExportMidi,
|