ApplyEffectDialog

Modal dialog for applying an effect chain to a transcript selection. Shows a chain picker, then dynamically renders that chain's controls (sliders for float/int, checkbox for bool) and preset buttons. A Preview button fetches and plays the processed audio without committing.

Constructor

new ApplyEffectDialog(chains, callbacks)

Parameters:
NameTypeDescription
chainsArray.<object>Effect chain metadata from GET /api/effect-chains.
callbacksobjectLifecycle callbacks for the dialog.
Properties
NameTypeAttributesDescription
fetchPreviewfunctionasync ({ chainId, controls }) => Blob
onApplyfunctionCalled with { chainId, controls }.
onDismissfunction<optional>
Called when the dialog is dismissed without applying.
titlestring<optional>
Dialog header text (default: "Apply Effect")
initialChainIdstring<optional>
Pre-select this chain on open.
initialControlsobject<optional>
Override control defaults when pre-selecting.
Example
new ApplyEffectDialog(chains, {
  fetchPreview: ({ chainId, controls }) => server.previewEffect(...),
  onApply:      ({ chainId, controls }) => { ... },
  onDismiss:    () => { ... },
});

// Edit mode — pre-select chain and populate existing control values:
new ApplyEffectDialog(chains, {
  title:          'Edit Effect',
  initialChainId: 'voice_changer',
  initialControls: { pitch: -4, formant_compensation: 2 },
  ...
});

Classes

ApplyEffectDialog

Methods

close()

Removes the dialog from the DOM and stops any in-progress preview.