improve details of MIDI Input
This commit is contained in:
parent
68c70a362b
commit
cbe299583b
@ -487,7 +487,7 @@ const AudiotrackEditor: FC<{ setPrompt: (prompt: string) => void }> = observer((
|
||||
}
|
||||
}
|
||||
}
|
||||
const result = globalMessages.map(m => midiMessageToToken(m)).join('');
|
||||
const result = ('<pad> ' + globalMessages.map(m => midiMessageToToken(m)).join('')).trim();
|
||||
commonStore.setCompositionSubmittedPrompt(result);
|
||||
setPrompt(result);
|
||||
}}>
|
||||
|
@ -98,6 +98,13 @@ const CompositionPanel: FC = observer(() => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!(commonStore.activeMidiDeviceIndex in commonStore.midiPorts)) {
|
||||
commonStore.setActiveMidiDeviceIndex(-1);
|
||||
CloseMidiPort();
|
||||
}
|
||||
}, [commonStore.midiPorts]);
|
||||
|
||||
const generateNs = (autoPlay: boolean) => {
|
||||
fetch(getServerRoot(port) + '/text-to-midi', {
|
||||
method: 'POST',
|
||||
@ -270,7 +277,9 @@ const CompositionPanel: FC = observer(() => {
|
||||
content={
|
||||
<div className="flex flex-col gap-1">
|
||||
<Dropdown style={{ minWidth: 0 }}
|
||||
value={commonStore.activeMidiDeviceIndex === -1 ? t('None')! : commonStore.midiPorts[commonStore.activeMidiDeviceIndex].name}
|
||||
value={(commonStore.activeMidiDeviceIndex === -1 || !(commonStore.activeMidiDeviceIndex in commonStore.midiPorts))
|
||||
? t('None')!
|
||||
: commonStore.midiPorts[commonStore.activeMidiDeviceIndex].name}
|
||||
selectedOptions={[commonStore.activeMidiDeviceIndex.toString()]}
|
||||
onOptionSelect={(_, data) => {
|
||||
if (data.optionValue) {
|
||||
|
Loading…
Reference in New Issue
Block a user