Skip to content

Commit 86a5c33

Browse files
committed
bugfix with seeking mode
1 parent 19664d8 commit 86a5c33

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

crates/notation_midi/src/midi_message.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,14 @@ impl MidiMessage {
5555
self.midi.data_byte_2().into(),
5656
]
5757
}
58+
pub fn should_send_in_seeking(&self) -> bool {
59+
match &self.midi {
60+
StructuredShortMessage::NoteOn {
61+
channel: _,
62+
key_number: _,
63+
velocity: _,
64+
} => true,
65+
_ => false,
66+
}
67+
}
5868
}

crates/notation_midi/src/midi_state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ impl MidiChannel {
157157
self.next_index += 1;
158158
count += 1;
159159
if !bypass {
160-
hub.send(settings, speed, next, velocity);
160+
if !is_seeking || next.should_send_in_seeking() {
161+
hub.send(settings, speed, next, velocity);
162+
}
161163
}
162164
} else {
163165
if next.effect_position().bar_ordinal < play_control.begin_bar_ordinal {

0 commit comments

Comments
 (0)