fix: MIDI keyboard preview silent after transport STOP — live flag bypass guard (V8)

This commit is contained in:
2026-08-16 15:43:23 +07:00
parent 2d63774474
commit b6950d6418
11 changed files with 1450 additions and 1448 deletions
+2 -1
View File
@@ -667,11 +667,12 @@ fn push_midi_event(
data2: u8,
data3: u8,
sample_offset: u32,
live: bool,
) -> Result<(), String> {
let state = app.state::<ShmState>();
let guard = state.0.lock().map_err(|e| e.to_string())?;
let shm = guard.as_ref().ok_or("bridge shm unavailable")?;
shm.push_midi(command, channel, pitch, velocity, data2, data3, sample_offset)
shm.push_midi(command, channel, pitch, velocity, data2, data3, sample_offset, live as u8)
.then_some(())
.ok_or_else(|| "midi queue full".to_string())
}
+3 -3
View File
@@ -34,7 +34,7 @@ pub struct MidiEventIPC {
pub velocity: u8,
pub data2: u8, // CC value / program / PB LSB
pub data3: u8, // PB MSB (0xE only)
pub reserved: [u8; 2],
pub reserved: [u8; 2], // reserved[0]: live flag (1=live input, bypass transportStopped guard); reserved[1]: 0
pub sample_offset: u32,
}
@@ -112,7 +112,7 @@ impl Shm {
unsafe { &mut *self.view }
}
pub fn push_midi(&self, cmd: u8, channel: u8, pitch: u8, velocity: u8, data2: u8, data3: u8, sample_offset: u32) -> bool {
pub fn push_midi(&self, cmd: u8, channel: u8, pitch: u8, velocity: u8, data2: u8, data3: u8, sample_offset: u32, live: u8) -> bool {
let ipc = self.ipc();
if ipc.midi_queue_count as usize >= MIDI_QUEUE_CAP {
return false;
@@ -125,7 +125,7 @@ impl Shm {
velocity,
data2,
data3,
reserved: [0u8; 2],
reserved: [live, 0u8],
sample_offset,
};
ipc.midi_queue_count += 1;