MIDI Recording and details improvement

This commit is contained in:
josc146
2023-11-29 14:05:58 +08:00
parent 14a13d5768
commit b625b8a6d1
13 changed files with 520 additions and 28 deletions

View File

@@ -3,6 +3,8 @@ import { useTranslation } from 'react-i18next';
import { Button, Dialog, DialogBody, DialogContent, DialogSurface, DialogTrigger } from '@fluentui/react-components';
import { CustomToastContainer } from '../../components/CustomToastContainer';
import { LazyImportComponent } from '../../components/LazyImportComponent';
import { flushMidiRecordingContent } from '../../utils';
import commonStore from '../../stores/commonStore';
const AudiotrackEditor = lazy(() => import('./AudiotrackEditor'));
@@ -13,7 +15,12 @@ export const AudiotrackButton: FC<{
}> = ({ size, shape, appearance }) => {
const { t } = useTranslation();
return <Dialog>
return <Dialog onOpenChange={(e, data) => {
if (!data.open) {
flushMidiRecordingContent();
commonStore.setRecordingTrackId('');
}
}}>
<DialogTrigger disableButtonEnhancement>
<Button size={size} shape={shape} appearance={appearance}>
{t('Open MIDI Input Audio Tracks')}