mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-16 08:08:34 +00:00
30 lines
1016 B
JavaScript
30 lines
1016 B
JavaScript
import React from 'react';
|
|
import { audioEngineTargets } from '../../../settings.mjs';
|
|
import { SelectInput } from './SelectInput';
|
|
|
|
// Allows the user to select an audio interface for Strudel to play through
|
|
export function AudioEngineTargetSelector({ target, onChange, isDisabled }) {
|
|
const onTargetChange = (target) => {
|
|
onChange(target);
|
|
};
|
|
const options = new Map([
|
|
[audioEngineTargets.webaudio, audioEngineTargets.webaudio],
|
|
[audioEngineTargets.osc, audioEngineTargets.osc],
|
|
]);
|
|
return (
|
|
<div className=" flex flex-col gap-1">
|
|
<SelectInput isDisabled={isDisabled} options={options} value={target} onChange={onTargetChange} />
|
|
{target === audioEngineTargets.osc && (
|
|
<div>
|
|
<p className="text-sm italic">
|
|
⚠ All events routed to OSC, audio is silenced! See{' '}
|
|
<a className="text-blue-500" href="https://strudel.cc/learn/input-output/">
|
|
Docs
|
|
</a>
|
|
</p>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|