fix: MIDI keyboard preview silent after transport STOP — live flag bypass guard (V8)
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user