From 514ef6b528b299c35fe0d11d9a031054e2ff8cde Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 8 Oct 2020 12:30:30 +0600 Subject: [PATCH] Add handling for KeyPress events and avoid calling snd_seq_sync_output_queue twice --- source/mididevices/music_alsa_mididevice.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/mididevices/music_alsa_mididevice.cpp b/source/mididevices/music_alsa_mididevice.cpp index 181f395..5aa7b7d 100644 --- a/source/mididevices/music_alsa_mididevice.cpp +++ b/source/mididevices/music_alsa_mididevice.cpp @@ -289,8 +289,8 @@ EventType AlsaMIDIDevice::PullEvent(EventState & state) { return EventType::Action; case MIDI_POLYPRESS: - // FIXME: Seems to be missing in the Alsa sequencer implementation - break; + snd_seq_ev_set_keypress(&state.data, channel, parm1, parm2); + return EventType::Action; case MIDI_CTRLCHANGE: snd_seq_ev_set_controller(&state.data, channel, parm1, parm2); @@ -427,7 +427,6 @@ void AlsaMIDIDevice::PumpEvents() { snd_seq_drain_output(sequencer.handle); snd_seq_sync_output_queue(sequencer.handle); } - snd_seq_sync_output_queue(sequencer.handle); snd_seq_stop_queue(sequencer.handle, QueueId, NULL); snd_seq_drain_output(sequencer.handle); }