MIDI Recording and details improvement
This commit is contained in:
@@ -7,6 +7,8 @@ import manifest from '../../manifest.json';
|
||||
import { defaultModelConfigs, defaultModelConfigsMac } from './pages/defaultConfigs';
|
||||
import { t } from 'i18next';
|
||||
import { Preset } from './types/presets';
|
||||
import { toast } from 'react-toastify';
|
||||
import { MidiMessage, MidiPort } from './types/composition';
|
||||
|
||||
export async function startup() {
|
||||
initPresets();
|
||||
@@ -26,6 +28,7 @@ export async function startup() {
|
||||
initLocalModelsNotify();
|
||||
initLoraModels();
|
||||
initHardwareMonitor();
|
||||
initMidi();
|
||||
}
|
||||
|
||||
await initConfig();
|
||||
@@ -134,3 +137,15 @@ async function initHardwareMonitor() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function initMidi() {
|
||||
EventsOn('midiError', (data: string) => {
|
||||
toast('MIDI Error: ' + data, { type: 'error' });
|
||||
});
|
||||
EventsOn('midiPorts', (data: MidiPort[]) => {
|
||||
commonStore.setMidiPorts(data);
|
||||
});
|
||||
EventsOn('midiMessage', async (data: MidiMessage) => {
|
||||
(await import('./pages/AudiotrackManager/AudiotrackEditor')).midiMessageHandler(data);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user