A14: MIDI-out từ plugin (VST2/VST3) → SHM → Rust emit → DAW track
- Vst2Instrument: audioMaster callback thu VstEvents, push SHM midiOutQueue
- Vst3Instrument: IEventList output bus (kAudioMasterWantMidi) — check
- SharedMemoryIPC.h: midiOutQueue[64] + midiOutCount (offset 27556/28324, sizeof 28328)
- shm.rs: MidiEventIPC Serialize, drain_midi_out() emit 'bridge-midi-out'
- lib.rs: pump emit midi-out events
- nativeBridgeService.js: onMidiOut API
- app.jsx: route MIDI-out về selected track qua SonicMidiRouter (feedback guard)
- TASKS.md: A14 ✅
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
activeInstrumentType: 'VST3',
|
||||
_audioCb: null,
|
||||
_statusCb: null,
|
||||
_midiOutCb: null,
|
||||
_tauri: function () { return window.__TAURI__; },
|
||||
|
||||
/** D10: UI subscribes to bridge connection changes. cb({connected}) or null to clear. */
|
||||
@@ -58,6 +59,12 @@
|
||||
if (!self.isBridgeConnected) self._reconnectIfNeeded();
|
||||
if (self._audioCb) self._audioCb(e.payload.l, e.payload.r);
|
||||
});
|
||||
// A14: plugin MIDI output (VstEvents -> SHM midiOutQueue -> pump).
|
||||
// Payload: array of {command, channel, pitch, velocity, data2,
|
||||
// data3, reserved, sample_offset}. JS routes notes to DAW tracks.
|
||||
window.__TAURI__.event.listen('bridge-midi-out', function (e) {
|
||||
if (self._midiOutCb) self._midiOutCb(e.payload);
|
||||
});
|
||||
window.__TAURI__.event.listen('bridge-down', function () {
|
||||
self._notifyStatus(false);
|
||||
if (window.SonicMidiRouter) window.SonicMidiRouter.setBridgeConnected(false);
|
||||
@@ -187,6 +194,13 @@
|
||||
*/
|
||||
onAudio: function (cb) {
|
||||
this._audioCb = cb;
|
||||
},
|
||||
|
||||
/** A14: register consumer of plugin MIDI output.
|
||||
* cb(events): array of {command, channel, pitch, velocity, data2,
|
||||
* data3, reserved, sample_offset} — route to DAW tracks. */
|
||||
onMidiOut: function (cb) {
|
||||
this._midiOutCb = cb;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user